Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Week and Day views are displayed by hour, and each hour is displayed in "military time." This is unusable for a marketing/communications calendar in the USA. So I'm looking for the setting or view element that allows me to change this, but such a configuration does not appear to be available. Please fix this or suggest a work-around. Any help would be greatly appreciated, and I thank you from the bottom of my heart for any assistance.
Comment | File | Size | Author |
---|---|---|---|
#12 | image-1.png | 5.17 KB | frederico |
#12 | image-2.png | 3.8 KB | frederico |
#8 | drupal7-calendar-week-view-military-time.gif | 101.54 KB | mcubed4130 |
Comments
Comment #1
frederico CreditAttribution: frederico commentedTry the following: > Admin > config > regional > date-time. This should help you. -Frederico Garza
Comment #2
MrSasquatch CreditAttribution: MrSasquatch commented@frederico, Your comment doesn't seem to have anything to do with my problem. Can you please be more specific? Thanks much.
Comment #3
nateman332 CreditAttribution: nateman332 commentedgo to: > Admin > config > regional > date-time > formats > add, then add your format, it should look something like this: F j, g:i A Y, this will output "April 3, 1:01 PM (or pm, I can't remember) 2013".
Then in admin > config > regional > date-time, you can select your new format as a date type (using the one that your calendar is using, for example "long"). and ta-da! no more army time!!!
Comment #4
nateman332 CreditAttribution: nateman332 commentedComment #5
MrSasquatch CreditAttribution: MrSasquatch commented@nateman332 that did not work. May I ask... Did this work for you, or was it just a theory. Because your advice doesn't seem to have anything to do with Calendar. I am not aware of Calendar using a specific date type that can be configure in the admin the way you described. I tried several, and changing them did not seem to make a difference in any way whatsoever.
The week and day views for Calendar are still stuck in "military time." Can anyone help me with this?
Thanks in advance for anyone's assistance—greatly appreciated!
Comment #6
nateman332 CreditAttribution: nateman332 commentedMy advice had everything to do with calendar and it's what worked for me.
You will need to edit the time/date field in your view and change your format.
At the moment I don't have the time to go into any more detail.
Comment #7
nateman332 CreditAttribution: nateman332 commentedsee Priority docs
Comment #8
mcubed4130 CreditAttribution: mcubed4130 commentedIs anyone willing to post a solution to this issue? It's quite annoying.
And to be clear - I'm not speaking of the times in the calendar entries.
I'm talking about the hours listed down the left hand side - that start at "01" and continue to "23"; when you are in the "week" or "day" view of the calendar.
All previous posts on solving the issue, at least to me have appeared to concentrate on how to display times within a specific calendar entry; not the calendar layout itself.
-Michael
Comment #9
MrSasquatch CreditAttribution: MrSasquatch commented@mcubed4138, Thank you so much for finally articulating what I could not. You are so right. The previous attempts at a solution were clearly talking about the time in the event node itself, which is completely irrelevant. Yes, we are talking about the military time labels down the left side of week and day view. Can someone please help us with this? This does not appear to be configurable on our end. Please help! Thank you in advance for any assistance that anyone can provide.
Comment #10
nateman332 CreditAttribution: nateman332 commentedFinnaly some one posted a screen shot and better explained it, now maybe people can help.
All the advice I can give you atm is to look at the template files for calendar module.
Comment #11
MrSasquatch CreditAttribution: MrSasquatch commentedEveryone, please make sure you share your solution if you find one. Myself, I cannot edit template files. I have too many installations with too many modules, all needing constant updating. To minimize overhead, I do not customize template files. So any help with this is greatly appreciated. I will sweeten the pot a bit with a $25 (US) bounty via paypal. Solve this problem to my satisfaction, and you'll enjoy a sweet $25 payday that you can spend on an overpriced burger at a swanky pub, or a sack of rice, or whatever you need. -John
Comment #12
frederico CreditAttribution: frederico commentedI was able to accomplish this using the following procedure (found in the header in http://yoursite.com/admin/config/date/date_popup):
A. Convert Time Format:
1. Go to yoursite.com/admin/config/regional/date-time
2. Select the U.S. civilian (am/pm) time formats for each combobox.
3. Click the Save Configuration button.
B. Install Dropdown TimePicker
1. Install the dropdown timepicker, create a sites/all/libraries/wvega-timepicker directory in your site installation. Then visit https://github.com/wvega/timepicker/archives/master, download the latest copy and unzip it. You will see files with names like jquery.timepicker-1.1.2.js and jquery.timepicker-1.1.2.css. Rename them to jquery.timepicker.js and jquery.timepicker.css and copy them into sites/all/libraries/wvega-timepicker.
2. Go to http://yoursite.com/admin/config/date/date_popup
3. Click on the Timepicker combobox. A new option appears.
4. Choose "Use default jQuery timepicker".
5. Click the Save Configuration button.
The calendar day view should now show the time in the AM/PM format (see image-1_0.png).
It also now allows people to type in the Time field in the AM/PM format (see image-2_0.png).
I hope this helps. -Frederico Garza
Comment #13
burgesscdb CreditAttribution: burgesscdb commentedI was having an issue with the Event Calendar defaulting to military time. I set the regional settings to civilian time and the calendar still reflected military time. After a lot of searching, I found the following setting that fixed my problem in Drupal 7:
Structure > Content Types > Event Calendar > Manage Fields > Date (Edit) > More settings and values > Date entry options dropdown box. I then set the value to civilian time.
I understand this isn't exactly the same issue, but it may help someone.
Good luck!
Comment #14
MrSasquatch CreditAttribution: MrSasquatch commented#13 doesn't seem to be relevant. I already had a date entry option that was a "civilian time" sort of option, so there's nothing I can choose that would affect the outcome and fix this issue.
#12 I have not tried. I'm concerned why it is necessary to install a "timepicker" when that is not the problem. I only want to change the way the time is displayed by the Calendar module. These seems like it should be an issue with Calendar module, not a completely different module that I do not need.
Thoughts?
Comment #15
byrond CreditAttribution: byrond commented#3 seems to be close to the solution. The row labels for the Week and Day displays use the "Short" Date Type. I wanted to make the same change, so I went to admin/config/regional/date-time and changed the Short date type to a format that included the 12-hour time. When I did that, the labels changed on my calendar view.
Comment #16
stedmanj CreditAttribution: stedmanj commented+1 for #15. This worked for me!
Comment #17
jive01 CreditAttribution: jive01 commentedThis isn't working for me. Can someone post step by step directions?
Comment #18
jive01 CreditAttribution: jive01 commentedActually rereading, #15 worked like a Charm. Calendars are using the short date format. Thanks @sedmanj
Comment #19
MrSasquatch CreditAttribution: MrSasquatch commented#15 worked for me, too. Thank you, @byrond !!!
Comment #20
steveco2310 CreditAttribution: steveco2310 commentedI messed with the suggestions and had no luck until i changed the format in config>date and time> and made sure each type (long, med, short) all used a "am" in the format and had success
Comment #21
kenorb CreditAttribution: kenorb commentedSame here, all Long/Medium/Short are AM/PM (with the latest dev), but calendar-week.tpl.php doesn't shows in AM/PM format.
In my case the problem was, that I was overriding preprocess functions in hook_theme_registry_alter(), by using Booking Time Slots (now fixed).
So it's not a Calendar bug, unless somebody has some specific steps to reproduce the issue.
Just double check what do you have in
date_format_short
variable (it should havea
/A
).Calendar checks that format in theme_calendar_time_row_heading() (theme/theme.inc).
So make sure that you've the right format at /admin/config/regional/date-time (AM/PM) and clear you caches.
Comment #22
kenorb CreditAttribution: kenorb commentedComment #23
butterwise CreditAttribution: butterwise commented#20 worked for me
Comment #24
Stephen OllmanIn Drupal 8 change the Default Short Date Format to: d/m/Y - g:ia