/* = jquery.eventCalendar.js version: 0.7 date: 13-08-2015 author: Jaime Fernandez (@vissit) company: Paradigma Tecnologico (@paradigmate) url: http://www.vissit.com/projects/eventCalendar/ */ ;(function( $ ) { $.fn.eventCalendar = function(options){ var calendar = this; if ( options.locales && typeof(options.locales) == 'string' ) { $.getJSON(options.locales, function(data) { options.locales = $.extend({}, $.fn.eventCalendar.defaults.locales, data); moment.locale(data.locale, options.locales.moment); moment.locale(data.locale); initEventCalendar(calendar, options); }).error(function() { showError("error getting locale json", $(this)); }); } else { if ( options.locales && options.locales.locale ) { options.locales = $.extend({}, $.fn.eventCalendar.defaults.locales, options.locales); moment.locale(options.locales.locale, options.locales.moment); moment.locale(options.locales.locale); } initEventCalendar(calendar, options); } }; // define the parameters with the default values of the function /** Start Added by Calvin 20230129 */ var lang = $("html").attr("lang"); var nextText = ""; var previousText = ""; if(lang == "en") { nextText = "Next Month"; previousText = "Previous Month"; } else if(lang == "zh-hk") { nextText = "下月"; previousText = "上月"; } else { nextText = "下月"; previousText = "上月"; } /** End Added by Calvin 20230129 */ $.fn.eventCalendar.defaults = { eventsjson: 'js/events.json', eventsLimit: 999, locales: { locale: "en", txt_noEvents: "There are no events in this period", txt_SpecificEvents_prev: "", txt_SpecificEvents_after: "events:", txt_next: "next", txt_prev: "prev", txt_NextEvents: "Next events:", /** Start Updated by Calvin 20230129 */ txt_PreviousMonth: previousText, txt_NextMonth: nextText, /** End Updated by Calvin 20230129 */ txt_GoToEventUrl: "See the event", txt_loading: "loading...", txt_Time: "Time", txt_Registration :"Registration" }, showOnlyFuture: false, showDayAsWeeks: true, startWeekOnMonday: true, showDayNameInCalendar: true, showDescription: false, onlyOneDescription: true, openEventInNewWindow: false, eventsScrollable: false, dateFormat: "D/MM/YYYY", jsonDateFormat: 'timestamp', // you can use also "human" 'YYYY-MM-DD HH:MM:SS' moveSpeed: 500, // speed of month move when you clic on a new date moveOpacity: 0.15, // month and events fadeOut to this opacity jsonData: "", // to load and inline json (not ajax calls) cacheJson: true // if true plugin get a json only first time and after plugin filter events // if false plugin get a new json on each date change }; function initEventCalendar(that, options) { var eventsOpts = $.extend({}, $.fn.eventCalendar.defaults, options); // define global vars for the function var flags = { wrap: "", directionLeftMove: "300", eventsJson: {} }; // each eventCalendar will execute this function that.each(function(){ flags.wrap = $("#page_eventscalendar"); flags.wrap.find("#calendar").addClass('eventCalendar-wrap'); flags.wrap.find("#modal_calendar_result").addClass('eventCalendar-wrap').append("
' + eventsOpts.locales.txt_noEvents + '