A Date-like object which implements the Hebrew calendar
A Date-like object which implements the Hebrew Calendar. Because this object implements many of the same methods as the native JavaScript Date object, which implements the Gregorian calendar, it can often be used its place. Note that this object does not extend Date or use its prototype.
See the dojox/date/hebrew/Date reference documentation for more information.
dojo.require("dojox.date.hebrew.Date"); var date = new dojox.date.hebrew.Date(); console.log(date.getFullYear()+'\'+date.getMonth()+'\'+date.getDate());
Parameter | Type | Description |
---|---|---|
numerator | undefined | |
denominator | undefined | |
remainder | undefined |
returns the Julian day of a Gregorian date
Parameter | Type | Description |
---|---|---|
gdate | undefined |
This function sets this Date to the Hebrew Date corresponding to the Gregorian Date
Parameter | Type | Description |
---|---|---|
gdate | Date |
This function sets this Date to the Hebrew Date corresponding to the Gregorian Date
var dateHebrew = new dojox.date.hebrew.Date(); var dateGregorian = new Date(2008,10,12); dateHebrew.fromGregorian(dateGregorian);
returns the date value (1 - 30)
var date1 = new dojox.date.hebrew.Date(); console.log(date1.getDate());
returns the date value as hebrew numerals for the Hebrew locale, a number for all others.
Parameter | Type | Description |
---|---|---|
locale | String |
Optional
|
var date1 = new dojox.date.hebrew.Date(); console.log(date1.getDate());
returns weekday value (0 - 6)
var date1 = new dojox.date.hebrew.Date(); console.log(date1.getDay());
returns the number of days in the given month and year
Parameter | Type | Description |
---|---|---|
month | Number | |
year | Number |
returns the Year value
var date1 = new dojox.date.hebrew.Date(5769, 6, 1); console.log(date1.getFullYear()); >> 5769
returns the month value (0 - 12)
the result is the index in the month array:
For non leap years, for months after Shevat, the actual position of the month in the year (used for short format) is less than the "absolute" index by 1.
var date1 = new dojox.date.hebrew.Date(5769, 6, 1); console.log(date1.getMonth()+1); >> 7
Determines if the year (argument) is a leap year
The Leap year contains additional month adar sheni
Parameter | Type | Description |
---|---|---|
year | Number |
sets the date number for a given month
Parameter | Type | Description |
---|---|---|
date | number |
sets the date number for a given month
var date1 = new dojox.date.hebrew.Date(5769, 6, 1); date1.setDate(2);
set the year
Parameter | Type | Description |
---|---|---|
year | number | |
month | number |
Optional
|
date | number |
Optional
|
set the year
var date1 = new dojox.date.hebrew.Date(); date1.setFullYear(5768); date1.setFullYear(5768, 1, 1);
sets the hour
Sets the hour and optionally minutes, seconds, milliseconds also.
sets the hour
var date1 = new dojox.date.hebrew.Date(); date1.setHours(12, 30, 0, 0);
sets the minutes (0-59) only.
Parameter | Type | Description |
---|---|---|
minutes | Number |
sets the minutes (0-59) only.
sets the month. You should use "absolute" index in the month array:
For non leap years, for months after Shevat, the actual position of the month in the year (used for short format) is less than the "absolute" index by 1.
Parameter | Type | Description |
---|---|---|
month | number |
sets the month. You should use "absolute" index in the month array:
For non leap years, for months after Shevat, the actual position of the month in the year (used for short format) is less than the "absolute" index by 1.
var date1 = new dojox.date.hebrew.Date(); date1.setMonth(0); //first month
sets the seconds (0-59) only.
Parameter | Type | Description |
---|---|---|
seconds | Number |
sets the seconds (0-59) only.
returns the equivalent Gregorian date value as a native Date object
var dateHebrew = new dojox.date.hebrew.Date(5768,11,20); var dateGregorian = dateHebrew.toGregorian();
returns a string representation of the date in "dd, MM, yyyy HH:mm:ss" format
returns a string representation of the date in "dd, MM, yyyy HH:mm:ss" format (all numeric) For user presentation, use dojox.date.hebrew.locale.format which will present in the appropriate language and format. toString() language- and culturally-specific conventions to keep this module free of dependencies on dojox.date.locale and dojo.cldr.
var date1 = new dojox.date.hebrew.Date(5769, 6, 1); console.log(date1.toString()); >>> "1, 6, 5769 0:0:0"