CGCalendar use 'am' and 'pm' instead of 'a' and 'p'

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: CGCalendar use 'am' and 'pm' instead of 'a' and 'p'

Post by paulbaker »

Assuming you're talking about the main default calendar layout (the one month grid) then no I haven't worked that out. It uses https://fullcalendar.io/ so it should be possible given a bit of investigation.
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

Re: CGCalendar use 'am' and 'pm' instead of 'a' and 'p'

Post by paulbaker »

Try putting // before the last .replace - it is that line which strips the "m" bit.

// makes it a comment rather than an instruction.
To copy System Information to the forum:
https://docs.cmsmadesimple.org/troubles ... nformation

CMS Made Simple Geekmoots attended:
Nottingham, UK 2012 | Ghent, Belgium 2015 | Leicester, UK 2016
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: CGCalendar use 'am' and 'pm' instead of 'a' and 'p'

Post by velden »

Last time I used the CGCalendar module no changes needed to be made in js files.

fullcalendar.io allows to set all options via javascript options. It should be possible to set those inside the template.

fullcalendar.io uses the formating from moments.js (http://momentjs.com/docs/#/displaying/format/) and added the t/T formats (https://fullcalendar.io/docs/utilities/ ... ng_string/)

Now, inside the template you need to find out where to put the options for your view. https://fullcalendar.io/docs/text/timeFormat/
(Try changing the 't' to an 'a' for am/pm)
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: CGCalendar use 'am' and 'pm' instead of 'a' and 'p'

Post by velden »

There are no references so it's using defaults. The fullcalendar.io documentation is giving examples. I don't have the module installed so can't test.

Did you try? E.g.:

Code: Select all

....
  dayNamesShort: dateStrings.dayNamesShort,
  timeFormat: 'h:mm a',
  firstDay: {$firstdayofweek},
....
Locked

Return to “Modules/Add-Ons”