-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect month calculation #235
Comments
This is not an issue with my library. Months in Javascript are from 0 to 11. So to get March 14, 2004, one would do: See |
Thanks for clarifying, bhaji. I was just pointing out the Punjabidate in the object returned, which says "punjabiDate: Object {month: "੨", monthName: "ਵੈਸਾਖ", date: "੧", year: "੫੩੬", ". Please ignore and close the ticket, if it is by design. Chardi kala! |
No problem! I am not sure why JS has months from Here is the output if a Date object is initialized as const n = require('nanakshahi')
const date = new Date(2004, 2, 14)
console.log( n.getNanakshahiDate( date ) ) Output: Object
gregorianDate: Sun Mar 14 2004 00:00:00 GMT-0500 (Eastern Standard Time)
englishDate: Object {month: 1, monthName: "Chet", date: 1, year: 536, day: "Aitvaar", dayShort: "Ait"}
punjabiDate: Object {month: "੧", monthName: "ਚੇਤ", date: "੧", year: "੫੩੬", day: "ਐਤਵਾਰ", dayShort: "ਐਤ"}
leapYear: false |
Hello Sarabveer:
While testing out the Nanakshahi library to cross-reference data for my own ruby library on some dates, I came across what appears to be a bug. Please have a look. Regards
Output was Vaisakh 1, but should be Chet 1
The text was updated successfully, but these errors were encountered: