dojox/date/hebrew/Date (version 1.10)

Summary

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.

Usage

var foo = new Date();
dojox/date/hebrew/Date

See the dojox/date/hebrew/Date reference documentation for more information.

Examples

Example 1

dojo.require("dojox.date.hebrew.Date");

var date = new dojox.date.hebrew.Date();
console.log(date.getFullYear()+'\'+date.getMonth()+'\'+date.getDate());

Property Summary

Method Summary

Properties

_date
_day
_GREGORIAN_MONTH_COUNT
_hours
_LEAP_MONTH_START
_milliseconds
_minutes
_month
_MONTH_LENGTH
_MONTH_START
_seconds
_year

Methods

_addMilliseconds(milliseconds)
Parameter Type Description
milliseconds Number
Returns:function
_addMinutes(minutes)
Parameter Type Description
minutes Number
Returns:function
_addSeconds(seconds)
Parameter Type Description
seconds Number
Returns:function
_computeHebrewFields(gdate)
Parameter Type Description
gdate Date
Returns:Array
_floorDivide(numerator,denominator,remainder)
Parameter Type Description
numerator undefined
denominator undefined
remainder undefined
Returns:undefined
_getJulianDayFromGregorianDate(gdate)

returns the Julian day of a Gregorian date

Parameter Type Description
gdate undefined
Returns:number
_handleGetYearLength(eyear)
Parameter Type Description
eyear number
Returns:number
_setDay()
_startOfYear(year)
Parameter Type Description
year number
Returns:number
_yearType(year)
Parameter Type Description
year Number
Returns:number
fromGregorian(gdate)

This function sets this Date to the Hebrew Date corresponding to the Gregorian Date

Parameter Type Description
gdate Date
Returns:function

This function sets this Date to the Hebrew Date corresponding to the Gregorian Date

Examples

Example 1

var dateHebrew = new dojox.date.hebrew.Date();
var dateGregorian = new Date(2008,10,12);
dateHebrew.fromGregorian(dateGregorian);
getDate()

returns the date value (1 - 30)

Returns:undefined

Examples

Example 1

var date1 = new dojox.date.hebrew.Date();
console.log(date1.getDate());
getDateLocalized(locale)

returns the date value as hebrew numerals for the Hebrew locale, a number for all others.

Parameter Type Description
locale String
Optional
Returns:undefined

Examples

Example 1

var date1 = new dojox.date.hebrew.Date();
console.log(date1.getDate());
getDay()

returns weekday value (0 - 6)

Returns:number

Examples

Example 1

var date1 = new dojox.date.hebrew.Date();
console.log(date1.getDay());
getDaysInHebrewMonth(month,year)

returns the number of days in the given month and year

Parameter Type Description
month Number
year Number
Returns:undefined
getFullYear()

returns the Year value

Returns:undefined

Examples

Example 1

var date1 = new dojox.date.hebrew.Date(5769, 6, 1);
console.log(date1.getFullYear());
>> 5769
getHours()

returns the hour value

Returns:undefined
getMilliseconds()

returns the milliseconds value

Returns:undefined
getMinutes()

returns the minutes value

Returns:undefined
getMonth()

returns the month value (0 - 12)

the result is the index in the month array:

  1. Tishri
  2. Heshvan
  3. Kislev
  4. Tevet
  5. Shevat
  6. Adar I (leap years only)
  7. Adar
  8. Nisan
  9. Iyar
  10. Sivan
  11. Tammuz
  12. Av
  13. Elul - 12

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.

Returns:undefined

Examples

Example 1

var date1 = new dojox.date.hebrew.Date(5769, 6, 1);
console.log(date1.getMonth()+1);
>> 7
getSeconds()

returns the seconds value

Returns:undefined
isLeapYear(year)

Determines if the year (argument) is a leap year

The Leap year contains additional month adar sheni

Parameter Type Description
year Number
Returns:boolean
setDate(date)

sets the date number for a given month

Parameter Type Description
date number
Returns:function

sets the date number for a given month

Examples

Example 1

var date1 = new dojox.date.hebrew.Date(5769, 6, 1);
date1.setDate(2);
setFullYear(year,month,date)

set the year

Parameter Type Description
year number
month number
Optional
date number
Optional
Returns:function

set the year

Examples

Example 1

var date1 = new dojox.date.hebrew.Date();
date1.setFullYear(5768);
date1.setFullYear(5768, 1, 1);
setHours()

sets the hour

Sets the hour and optionally minutes, seconds, milliseconds also.

Returns:function

sets the hour

Examples

Example 1

var date1 = new dojox.date.hebrew.Date();
date1.setHours(12, 30, 0, 0);
setMilliseconds(milliseconds)
Parameter Type Description
milliseconds Number
Returns:function
setMinutes(minutes)

sets the minutes (0-59) only.

Parameter Type Description
minutes Number
Returns:function

sets the minutes (0-59) only.

setMonth(month)

sets the month. You should use "absolute" index in the month array:

  1. Tishri
  2. Heshvan
  3. Kislev
  4. Tevet
  5. Shevat
  6. Adar I (leap years only)
  7. Adar
  8. Nisan
  9. Iyar
  10. Sivan
  11. Tammuz
  12. Av
  13. Elul - 12

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
Returns:function

sets the month. You should use "absolute" index in the month array:

  1. Tishri
  2. Heshvan
  3. Kislev
  4. Tevet
  5. Shevat
  6. Adar I (leap years only)
  7. Adar
  8. Nisan
  9. Iyar
  10. Sivan
  11. Tammuz
  12. Av
  13. Elul - 12

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.

Examples

Example 1

var date1 = new dojox.date.hebrew.Date();
date1.setMonth(0); //first month
setSeconds(seconds)

sets the seconds (0-59) only.

Parameter Type Description
seconds Number
Returns:function

sets the seconds (0-59) only.

toGregorian()

returns the equivalent Gregorian date value as a native Date object

Returns:instance

Examples

Example 1

var dateHebrew = new dojox.date.hebrew.Date(5768,11,20);
var dateGregorian = dateHebrew.toGregorian();
toString()

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.

Returns:string

Examples

Example 1

var date1 = new dojox.date.hebrew.Date(5769, 6, 1);
console.log(date1.toString());
>>> "1, 6, 5769 0:0:0"
valueOf()
Error in the documentation? Can’t find what you are looking for? Let us know!