Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar. Time format 24h #3856

Closed
OleksiyOleksiyovych opened this issue Mar 22, 2016 · 4 comments
Closed

Calendar. Time format 24h #3856

OleksiyOleksiyovych opened this issue Mar 22, 2016 · 4 comments
Assignees

Comments

@OleksiyOleksiyovych
Copy link

Steps to reproduce

  1. Install Magento from develop or master branch.
  2. Create custom extension and try to use calendar.
  3. https://www.dropbox.com/s/xxzjp3vn2z6jskg/Screenshot%202016-03-22%2010.10.06.png
$("#datatime").calendar({
       timeFormat: "HH:mm:ss",
});

Expected result

  1. We want to see 24h format, like 21:34:45 (does not 9:34:45 PM).

Actual result

  1. We have AM/PM fromat

Reason

File /lib/web/mage/calendar.js
Lines 396-400

time: {
      'a': 'tt',
      'HH': 'hh',
      'H': 'h'
}

This mask change string format

  • from 'HH:mm:ss' to 'hh:mm:ss'
  • from 'H:mm:ss' to 'h:mm:ss'

Why do we need this transformations?

@guz-anton
Copy link
Contributor

guz-anton commented May 5, 2016

Why do we need this transformations?

Because main producer for date-time configuration is Backend (Php app with ICU datetime format).

@OleksiyOleksiyovych
Copy link
Author

Ok, but can I set 24h time format in calendar?

@kumbas1
Copy link
Contributor

kumbas1 commented May 5, 2016

Currently there is fix for issue MAGETWO-52178 waiting to be merged in mainline.

magento-team pushed a commit that referenced this issue May 13, 2016
- Format for literals 'H', 'h', 's', 'm' has same meaning in different parsers
@guz-anton
Copy link
Contributor

Fix was deivered to mainline (develop branch).

pdohogne-magento pushed a commit that referenced this issue Mar 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants