Foren

Display of Calendar Booking Events

Hiran Chaudhuri, geändert vor 9 Jahren.

Display of Calendar Booking Events

Regular Member Beiträge: 188 Beitrittsdatum: 01.09.10 Neueste Beiträge
In Liferay 6.2 there is a really lovely calendar portlet.

We use different timezones, and in the calendar portlet I'd like to emphasize the start/end time shown by adding the timezone (users may not be aware that the times are in GMT unless they set a timezone for their account).

What needs to be changed to get the timezone besides the hour?
thumbnail
Antoine Comble, geändert vor 8 Jahren.

RE: Display of Calendar Booking Events

Regular Member Beiträge: 232 Beitrittsdatum: 07.09.12 Neueste Beiträge
Hi,

I think you need edit these methods in components.js file :
line 1081 :

_uiSetEndDate: function(val) {
	var instance = this;
        Liferay.SchedulerEvent.superclass._uiSetEndDate.apply(instance, arguments);
        var node = instance.get('node');
        node.attr('data-endDate', instance._formatDate(val, '%m/%d/%Y'));
	node.attr('data-endTime', instance._formatDate(val, '%I:%M %p'));
},


line 1098 :

_uiSetStartDate: function(val) {
	var instance = this;
        var node = instance.get('node');
        node.attr('data-startDate', instance._formatDate(val, '%m/%d/%Y'));
	node.attr('data-startTime', instance._formatDate(val, '%I:%M %p'));
},


Regards,

Antoine
Hiran Chaudhuri, geändert vor 8 Jahren.

RE: Display of Calendar Booking Events

Regular Member Beiträge: 188 Beitrittsdatum: 01.09.10 Neueste Beiträge
Hmmm, I cannot find any such code in calendar-portlet/js/components.js. However there is similar code in calendar-portlet/js/javascript.js.
I changed it to contain %z and %Z and each time restarted Liferay and the browser just to be sure the new file is loaded. However neither the time zone nor the offset is displayed. It seems the date format is set elsewhere...?

 _uiSetStartDate: function(val) {
    var instance = this;
    var node = instance.get('node');
    node.attr('data-startDate', instance._formatDate(val, '%m/%d/%Y %I:%M %p %z'));
},