×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me

TOPIC: 12 Hour view in Calendar not showing.

12 Hour view in Calendar not showing. 10 years 2 months ago #25097

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
In the following field: COM_MATUKIO_CALENDAR_TIME_FORMAT, I have the following MySQL Syntax: %l:%m %p but the time of the events are still showing up 24 hour (example: 18:00 instead of 6:00 PM)

What is wrong?

12 Hour view in Calendar not showing. 10 years 2 months ago #25098

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hi Chris,

there is also a setting for twelve hour time format - did you change that to yes?

Best regards

Yves

12 Hour view in Calendar not showing. 10 years 2 months ago #25105

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
Yes, that option is set to yes with no change.

12 Hour view in Calendar not showing. 10 years 2 months ago #25106

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Okay did some debugging - there is a problem in the calendar script. Going to fix it with the next version - if you are in a hurry:

source/media/com_matukio/js/mooECal.js

Search for:

function thTime(timeFormat, timeTwelveHourFormat){

And just change this line:

return (this.getUTCHours() + ":" + minutes);

To:

return (this.format(timeFormat));

And set 12 hour time format to No. (The %p will take care of that).

Best regards,

Yves

12 Hour view in Calendar not showing. 10 years 2 months ago #25109

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
Thank you. I will try that.

12 Hour view in Calendar not showing. 10 years 2 months ago #25113

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
I have tried as you suggested, but as you can see from the screen shot, it does not work. It is doing something, but it is not right. The time on the first event should read 2:00 PM, not 7:02 AM. No idea. I will say that the time on the event listing page still looks fine.

Please attached.
Attachments:

12 Hour view in Calendar not showing. 10 years 2 months ago #25114

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
I searched a little further.

-What is happening, is the time displayed in the Calendar is subtracting 7 hours from the event time that is inputted. Please note that the event list page is displaying the correct time.
-Joomla setup is set to Denver (GMT-7).
-If I display time zones, it is showing GMT.
-The server is configured MST or GMT-7

Additional Information: I have Joomla Default and my User account set to MST or GMT-7.
The Calendar display recalculates the time to UTC, but the event detail is displaying the scheduled time in GMT-7 when "Display Time Zone" is turned on.
What appears to be happening is the calendar display is ignoring the GMT-7 calculation. I am happy to hard code this if there is no simple solution, but need pointed in the right direction.

I hope this information gives you insight into my problem.

12 Hour view in Calendar not showing. 10 years 2 months ago #25116

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hmm wired - normally all date / times are provided by Joomla JDate which uses the Joomla / Joomla users settings - i have the feeling that the formatting changes our time.

Can you try the following:

return (this.getUTCHours() + ":" + minutes + this.format('%p').toLowerCase());

Best regards

Yves

12 Hour view in Calendar not showing. 10 years 2 months ago #25117

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
We are getting closer. The times are now accurate, but it still only displays 24 hours format, and this is also an issue showing 15:00am instead of 3:00pm.
Thoughts?

Yves Hoppe wrote: Hmm wired - normally all date / times are provided by Joomla JDate which uses the Joomla / Joomla users settings - i have the feeling that the formatting changes our time.

Can you try the following:

return (this.getUTCHours() + ":" + minutes + this.format('%p').toLowerCase());

Best regards

Yves

12 Hour view in Calendar not showing. 10 years 2 months ago #25118

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Okay let's try that:
var hours = this.getUTCHours();
 var htext = (hours == 0 ? 12 : hours); // 0h is actually 12am
 htext = htext < 13 ? htext : htext - 12; // switch to 12hr time display
 return (htext + ":" + minutes + this.format('%p').toLowerCase());

Best regards

Yves

12 Hour view in Calendar not showing. 10 years 2 months ago #25119

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
We are so close.

Here is what it says now: 3:00am RPG Training, it should read "3:00pm".

12 Hour view in Calendar not showing. 10 years 2 months ago #25120

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hmm try adding this line next before return:

this.setHours(this.getUTCHours());

JavaScript screws up the timezone (GMT instead of GMT - 7) :unsure: .

Best regards

Yves

12 Hour view in Calendar not showing. 10 years 2 months ago #25121

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
THis is what I added:
var htext = (hours == 0 ? 12 : hours); // 0h is actually 12am
 htext = htext < 13 ? htext : htext - 12; // switch to 12hr time display
 this.setHours(this.getUTCHours());
 return (htext + ":" + minutes + this.format('%p').toLowerCase());

If that looks right to you, it caused that whole event entry to disappear off the calender. Upon commenting out the new line, the event shows backup.

Yves Hoppe wrote: Hmm try adding this line next before return:

this.setHours(this.getUTCHours());

JavaScript screws up the timezone (GMT instead of GMT - 7) :unsure: .

Best regards

Yves

12 Hour view in Calendar not showing. 10 years 2 months ago #25122

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hmm wired for me it works without problems and i don't see a typo in your code:

Here is the full thTime function (with some fixes i made for the next Version):

pastebin.com/KeVcn1cm

Just turn turn on twelve hour format again if you use it.

Best regards

Yves

12 Hour view in Calendar not showing. 10 years 2 months ago #25123

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
Thank you for the reply. I have inserted the thTimefuncion as suggested, but the (PM) times on the calendar are just disapearing now, while the times that are in AM are still showing.
Any ideas where else to check?

It is 1:37am here (GMT-7) ;) and will be asleep for a few hours before I get back on.

Yves Hoppe wrote: Hmm wired for me it works without problems and i don't see a typo in your code:

Here is the full thTime function (with some fixes i made for the next Version):

pastebin.com/KeVcn1cm

Just turn turn on twelve hour format again if you use it.

Best regards

Yves

12 Hour view in Calendar not showing. 10 years 2 months ago #25131

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
Yes, testing again with fresh eyes.

With the new code supplied in the pastebin.com link, It looks like all AM times are showing up and calculating correctly.

All PM times, however, don't even show on the calendar any more, however, they show up just fine in the event list.

We are really close, suggestions?

12 Hour view in Calendar not showing. 10 years 2 months ago #25132

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Did you switch back to twelve hour mode? They completly don't show up? Do they show up in the 24 hour mode? Wired, locally i have events with AM and PM times.

Best regards

Yves

12 Hour view in Calendar not showing. 10 years 2 months ago #25133

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
PM times completely disappear off the calendar. Didn't matter if 24 hour mode was selected or not.
Just to make sure my copy/paste of your code wasn't out of line, here is the thTime function to the end of the js file.
		function thTime(timeFormat, timeTwelveHourFormat){
		    // twelve hour time
            timeTwelveHourFormat = new Boolean(timeTwelveHourFormat);
 
            if (timeTwelveHourFormat == true) {
                var hours = this.getUTCHours();
                var htext = (hours == 0 ? 12 : hours); // 0h is actually 12am
                htext = htext < 13 ? htext : htext - 12; // switch to 12hr time display
 
                var minutes = this.getMinutes();
 
                if (minutes < 10){
                    minutes = "0" + minutes ;
                }
 
                this.setHours(hours);
 
                var ampm = this.format('%p').toLowerCase();
 
                return (htext + ":" + minutes + ampm)
            } else {
                var minutes = this.getMinutes();
 
                if (minutes < 10){
                    minutes = "0" + minutes ;
                }
 
                return (this.getUTCHours() + ":" + minutes);
            }
		}
 
		Date.prototype.nextMonth = nextMonth;
		Date.prototype.prevMonth = prevMonth;
		Date.prototype.endOfDay = endOfDay;
		Date.prototype.getMDay = getMDay;
		Date.prototype.ymd = ymd;
		Date.prototype.thTime = thTime;
	}
 
});

12 Hour view in Calendar not showing. 10 years 2 months ago #25138

  • Chris
  • Chris's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 29
  • Thank you received: 0
If you don't have solution, how can I hide the time from the calendar?

12 Hour view in Calendar not showing. 10 years 2 months ago #25139

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hi Chris,

did not forget you - still working on a solution :)

The subtraction somestimes goes wrong, because the utc hours are negative with GMT -7 :dry:

Ycou can just return an empty string return "";

Best regards

Yves
Time to create page: 0.278 seconds