You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Dayjs returns Invalid Date if the date entered by a user starts with day name.
Example code:
import * as dayjs from 'dayjs';
import 'dayjs/locale/fr';
var customParseFormat = require('dayjs/plugin/customParseFormat')
dayjs.extend(customParseFormat);
var localizedFormat = require('dayjs/plugin/localizedFormat')
dayjs.extend(localizedFormat)
var day = dayjs;
day.locale('fr'); //Using french locale
text = 'vendredi 1 janvier 2021 11:40:39 heure' ;
format = 'dddd D MMMM YYYY h:mm:ss A';
day(text, format, 'fr');
Executing the above line(day(text, format, 'fr')) is throwing the below error. It works only if the day name is given after YYYY. Example: '1 janvier 2021, vendredi 11:40:39 heure'.
Describe the bug
Dayjs returns Invalid Date if the date entered by a user starts with day name.
Example code:
Executing the above line(day(text, format, 'fr')) is throwing the below error. It works only if the day name is given after YYYY. Example: '1 janvier 2021, vendredi 11:40:39 heure'.
ERROR: M {$L: 'fr', $u: undefined, $d: Invalid Date, $y: NaN, $M: NaN, …}
Expected behavior
Dayjs should return correct Date if the date entered by a user starts with day name.
Information
The text was updated successfully, but these errors were encountered: