luxon
luxon copied to clipboard
setLocale method for Duration
Is your feature request related to a problem? Please describe.
DateTime
has setLocale
method as an alias for reconfigure({ locale: string })
. Duration
just doesn't so we need to use reconfigure
:
DateTime.fromISO('2023-07-10T14:52:00').setLocale('en-US');
Duration.fromISO('P2DT1H').reconfigure({ locale: 'en-US' });
Describe the solution you'd like
I'd like to be able to set locale in the same way as it is with DateTime
:
DateTime.fromISO('2023-07-10T14:52:00').setLocale('en-US');
Duration.fromISO('P2DT1H').setLocale('en-US');
Describe alternatives you've considered
Using reconfigure
method.