-
Notifications
You must be signed in to change notification settings - Fork 591
Closed
Labels
Description
Date parser is strict about parsing zero-padded date fields, for example parsing yMd skeleton for pt (that means pattern dd/MM/y), we have:
Globalize('pt').parseDate('23/02/2017');
// > 2017-02-23T03:00:00.000Z
Globalize('pt').parseDate('23/2/2017');
// > nullThough it's impossible to set parser to parse non-zero-padded day and month for pt unless it's used raw to pass the pattern itself (which is not recommended). Therefore, parser should be lenient about parsing those date fields, specially the ones below for the analogous reason.
- year:
date: "short"may includeyoryy, alsoyisn't the non-zero-padded foryy, what makes it even more mandatory to have a way to parse non-zero-addedyy. - month:
skeleton: "yMd"(i.e., oneM) may includeMMas the pattern); similarlyL. - day:
skeleton: "yMd"(i.e., oned) may includedordd - hour:
skeleton: "hms"(i.e., oneh) may includehorhh; similarlyHKk. - minute:
skeleton: "hms"(i.e., onem) always includesmm - second:
skeleton: "hms"(i.e., ones) always includesss
Reactions are currently unavailable