luxon icon indicating copy to clipboard operation
luxon copied to clipboard

setLocale method for Duration

Open lkster opened this issue 1 year ago • 0 comments

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.

lkster avatar Jul 10 '23 12:07 lkster