pikaday.js
/*
  Calculates the Julian Day number from Gregorian or Julian
  calendar dates. This integer number corresponds to the noon of
  the date (i.e. 12 hours of Universal Time).
  The procedure was tested to be good since 1 March, -100100 (of both
  calendars) up to a few million years into the future.
  @param gy Calendar year (years BC numbered 0, -1, -2, ...)
  @param gm Calendar month (1 to 12)
  @param gd Calendar day of the month (1 to 28/29/30/31)
  @return Julian Day number
*/
Calculates the Julian Day number from Gregorian or Julian
calendar dates. This integer number corresponds to the noon of
the date .
The procedure was tested to be good since 1 March, -100100 (of both
calendars) up to a few million years into the future.
Calculates the Julian Day number from Gregorian or Julian calendar dates . This integer number corresponds to the noon of the date . The procedure was tested to be good since 1 March - 100100 ( of both calendars ) up to a few million years into the future .
function g2d(gy, gm, gd) {
    var d = div((gy + div(gm - 8, 6) + 100100) * 1461, 4)
        + div(153 * mod(gm + 9, 12) + 2, 5)
        + gd - 34840408
    d = d - div(div(gy + 100100 + div(gm - 8, 6), 100) * 3, 4) + 752
    return d
}
function g2d ( gy , gm , gd ) { var d = div ( ( gy + div ( gm - 8 , 6 ) + 100100 ) * 1461 , 4 ) + div ( 153 * mod ( gm + 9 , 12 ) + 2 , 5 ) + gd - 34840408 d = d - div ( div ( gy + 100100 + div ( gm - 8 , 6 ) , 100 ) * 3 , 4 ) + 752 return d }
Calculates the Julian Day number from Gregorian or Julian
calendar dates.
Calculates the Julian Day number from Gregorian or Julian calendar dates .