Open smartphonedesign opened 3 years ago
When parsing the month from iMMM format it uses a one-based index. So, Shw is month 10, but then it converts it to the Gregorian equivalent using zero-based index and so it is off by one month.
const input = '22 Shw 1440'; const output = moment(input, 'iDD iMMM iYYYY').format('iDD iMMM iYYYY'); if (input !== output) { console.log(`${input} returned ${output}`); }
output is "22 Shw 1440 returned 22 Dhu-Q 1440"
When parsing the month from iMMM format it uses a one-based index. So, Shw is month 10, but then it converts it to the Gregorian equivalent using zero-based index and so it is off by one month.
output is "22 Shw 1440 returned 22 Dhu-Q 1440"