Hi @tobias1hdw,
Is the issue that in the calendar the time is displayed in 12h time? Like if we were to change this to 24 hour time would that be what you are after, or is there more to it than this?
Thanks,
Hi @northernbeacheswebsites,
it is exactly this!
Example:
Currently it is 4pm, but we are expecting 16:00.
We thought if we use the “Use WordPress Date/Time format” option this is what should happen.
THank you for you fast feedback ๐
Hi @tobias1hdw,
So the settings in the plugin only work for the table, they don’t work for the calendar. The reason for this is that the calendar is done by a javascript library whereas everything else is controlled by PHP by our plugin. There’s probably a way to send this setting to javascript, but that’s a little beyond my expertise.
However, if you don’t mind, I can give you a solution, but it would break upon update, so either don’t update the plugin, or re-apply the fix upon update. If you edit script.js (wp-gotowebibar/inc/script.js) and edit line 25 and change:
timeFormat: ‘h(:mm)a’,
to:
timeFormat: ‘H(:mm)a’,
That will resolve the issue. You may need to clear your browser/site/server cache if script.js if you don’t see the change come into affect.
I am sorry I can’t provide a more seamless solution. Thanks,
Hi @northernbeacheswebsites thank you for your fast feedback.
I would add the fix currently to the plugin files and stop updating the plugin.
Maybe there is a way to get this fix into the regular plugin? If you are using github, i could have a look into the code and try to get fix done. After that i could create a pull requests.
But only if you are interested ๐
Regard,
Tobi
Hi Tobi,
You are welcome to send a link to an updated plugin zip and just describe how it works, and I can then put this into the next release if you want.
Thanks,
Hi @northernbeacheswebsites,
i’ve quickly updated two files:
Line 5-34 on wp-gotowebibar/inc/script.js:
if ($('#calendar').length){
var calendarData = $('#calendar-data').attr('data');
var calendarTimeFormatSetting = $('#calendar-data').attr('data-time-format-setting');
var calendarTimeFormat = $('#calendar-data').attr('data-time-format-setting');
if(calendarTimeFormatSetting == 'wordpress'){
calendarTimeFormat = ($('#calendar-data').attr('data-time-format')).replace('i', 'mm');
}
var calendarDataDecodedAndParsed = JSON.parse(atob(calendarData));
var wordpressLocale = document.documentElement.lang;
// console.log(calendarDataDecodedAndParsed);
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listWeek'
},
navLinks: true, // can click day/week names to navigate views
editable: false,
height: 'auto',
locale: wordpressLocale.substr(0,2),
timezone: 'local',
timeFormat: calendarTimeFormat,
events: calendarDataDecodedAndParsed
})
}
Line 123 on wp-gotowebibar/inc/shortcode-calendar.php:
$html .= '<div id="calendar-data" data="'.base64_encode(json_encode($calendarData)).'" data-time-format="'.get_option('time_format').'" data-time-format-setting="'.$options['gotowebinar_time_format'].'"></div>';
This fixed my issue.
I am not sure if this is a global fix, but for the calendar it could work. If this solution is fine for you, feel free to add it to your plugin ๐
Thanks @tobias1hdw, I will look over this and put in the next version. Thanks for your work ๐