search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

TimeFormat recognizion doesn't seem to work perfectly in the calendar

Asked by Viktor Eriksson
7 years ago.

Using a swedish locale, timeFormat will display AM/PM which is wrong, we use 24 hour format.

Answer posted by Dan Letecky [DayPilot]
7 years ago.

The Swedish locale is defined like this:

DayPilot.Locale.register(new DayPilot.Locale('sv-se', 
{
  'dayNames':['söndag','måndag','tisdag','onsdag','torsdag','fredag','lördag'],'dayNamesShort':['sö','må','ti','on','to','fr','lö'],
  'monthNames':['januari','februari','mars','april','maj','juni','juli','augusti','september','oktober','november','december',''],
  'monthNamesShort':['jan','feb','mar','apr','maj','jun','jul','aug','sep','okt','nov','dec',''],
  'timePattern':'HH:mm',
  'datePattern':'yyyy-MM-dd',
  'dateTimePattern':'yyyy-MM-dd HH:mm',
  'timeFormat':'Clock24Hours',
  'weekStarts':1
}));

It looks like the locale might not be set correctly (using the default "en-us" locale?).

Running this following code in the JS console at the calendar demo page seems to work:

dp.locale = "sv-se";
dp.update();

http://javascript.daypilot.org/demo/calendar/index.html

This question is more than 3 months old and has been closed. Please create a new question if you have anything to add.