Is your feature request related to a problem? Please describe.
I sometimes work with ISO dates like "2015-04", but when display with toLocaleString(DateTime.DATE_SHORT) represented as 2015. 04. 01. (with 'HU' locale)
Describe the solution you'd like
Should be great a function (e.g has("day")) to validate that the parsed date contains specific part
const date = DateTime.fromISO("2015-04");
date.toLocaleString({
year: "2-digit",
month: date.has("month") ? "2-digit" : undefined,
day: date.has("day") ? "2-digit" : undefined,
}); // 2015. 04.
OR
toLocaleString just skip "empty" parts
const date = DateTime.fromISO("2015-04");
date.toLocaleString(DateTime.DATE_SHORT); // 2015. 04.
Is your feature request related to a problem? Please describe.
I sometimes work with ISO dates like "2015-04", but when display with toLocaleString(DateTime.DATE_SHORT) represented as 2015. 04. 01. (with 'HU' locale)
Describe the solution you'd like
Should be great a function (e.g
has("day")) to validate that the parsed date contains specific partOR
toLocaleString just skip "empty" parts