Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
IgxTimepicker 24 hours format issue (AM/PM)
posted

Please refer to this

https://ko.infragistics.com/products/ignite-ui-angular/angular/components/time-picker

When user types into the time picker which contains a 24 hour value "18:00" it converts into 06:00 AM 

Expectation: 

When user types into the time picker which contains a 24 hour value "18:00" it should converts into 06:00 PM

Parents
No Data
Reply
  • 460
    Offline posted

    Hello Nouman,

    I have been looking into your question and this is the expected behavior and result that follows setting only the time but not the abbreviation whether AM or PM. This is because the input format for the time in this sample is set to hh:mm tt, which means the user is prompted to enter the hour, minutes as well as AM or PM, if this does not happen and the user does not enter the given abbreviation, but only the hours and minutes, then by default it remembers AM. Also, the small h stands for the hours from 1 to 12 only, not all hours 1 to 24.

    What I could suggest as an approach is to change the input format according to your custom logic or to explicitly mention and remember the abbreviation AM/PM if you use this format. Another format you could use is HH:mm for hours and minutes 24 hour time with the capital H standing for all hours from 1 to 24 and so when you enter a given hour and minute it will be displayed in the given format.

    The described scenario could be observed here:

     

    In addition, I have prepared small sample illustrating this behavior which could be found here. Please test it on your side and let me know how it behaves.

    If you require any further assistance on the matter, please let me know.

    Regards,

    Georgi Anastasov

    Entry Level Software Developer

    Infragistics

Children
No Data