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

amCalendar don't return 24-hour format #184

Open
theunreal opened this issue Nov 21, 2017 · 2 comments
Open

amCalendar don't return 24-hour format #184

theunreal opened this issue Nov 21, 2017 · 2 comments

Comments

@theunreal
Copy link

theunreal commented Nov 21, 2017

Using the following example:

@Component({
  selector: 'app',
  template: `
    Last updated: {{myDate | amCalendar}}
  `
})

Which should print (from the readme)
Last updated: Today at 14:00

what I actually get:

Today at 10:11 AM

Any way to use 24-hour format here?

@psalkowski
Copy link

The whole problem is, there is no way to set calendar formats globally: https://momentjs.com/docs/#/displaying/calendar-time/

moment().calendar(null, {
    sameDay: '[Today]',
    nextDay: '[Tomorrow]',
    nextWeek: 'dddd',
    lastDay: '[Yesterday]',
    lastWeek: '[Last] dddd',
    sameElse: 'DD/MM/YYYY'
});

The above code will not work, because of webpack and angular. Maybe consider to add MomentModule.forRoot() with calendar property that will hold this config?

@urish
Copy link
Owner

urish commented Jul 14, 2018

Should be possible to set the calendar format globally, as outlined here: https://momentjs.com/docs/#/customization/calendar/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants