I'm using the ng-pick-datetime picker for my application. I want the selected time to show in 24hr (15:00 instead of 3:00 pm). When the picker opens the time is displayed in the picker correctly, but once selected it changes it to 12hr time format. Is there a way to set the selected time to show in 24 hour time instead of 12 hour?

Here is a link to the picker I'm using: ng-pick-datetime
Put hour12: false to custom format, and just working see code below:
export const MY_NATIVE_FORMATS = {
fullPickerInput: {year: 'numeric', month: 'numeric', day: 'numeric', hour: 'numeric', minute: 'numeric', hour12: false},
datePickerInput: {year: 'numeric', month: 'numeric', day: 'numeric', hour12: false},
timePickerInput: {hour: 'numeric', minute: 'numeric', hour12: false},
monthYearLabel: {year: 'numeric', month: 'short'},
dateA11yLabel: {year: 'numeric', month: 'long', day: 'numeric'},
monthYearA11yLabel: {year: 'numeric', month: 'long'},
};
@NgModule({
providers: [
{provide: OWL_DATE_TIME_FORMATS, useValue: MY_NATIVE_FORMATS},
]
})
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With