When editing an event the Event Date field hides the century of the event.
For example, here is an event with a date of 1835-12-19: https://dl.dropbox.com/u/2071906/screencap2.png
If I edit the event the date is displayed as “12/19/35”: https://dl.dropbox.com/u/2071906/screencap3.png
I set the date format to YYYY-MM-DD, so it shouldn’t be displaying in MM/DD/YY format: https://dl.dropbox.com/u/2071906/screencap1.png
I can’t replicate your issue. I think there is an issue with another plugin and this one interacting because the placeholder text you have in the first picture of “month/day/year” isn’t part of this plugin even.
What other plugins do you have installed?
The only plugins I had installed were:
- W3 Total Cache
- WordPress SEO by Yoast
- WordPress Importer
I have a sandbox site that I use for testing so for grins I tried deactivating and deleting all but the plugins Akismet, Jetpack, and This Day In History. I even deactivated Akismet and Jetpack.
Athena Theme 1.0.4 using WooFramework 5.5.3
BTW, I also tried changing the Theme from WooThemes’ Athena to the “Twenty Twelve” theme with no effect. The placeholder text for “Event Date” still says “Month/Day/Year” and when I edit an existing date it does not display the century.
I even went so far as installing a fresh copy of WordPress 3.5.0 on a domain I was not using. It still looks the same.
I tried in a few different browsers and believe I’ve discovered the issue is in the way Google Chrome handles INPUT field with a type of “date.” Chrome appears to be one of the few browsers that has support for generating a date picker automatically for INPUT fields of type date. However, it uses a placeholder based on the localization settings set when you select your language.
Browser support for the INPUT type of date, which was introduced with HTML5, is still limited based on what I’ve found (Chrome, Safari, Opera): http://www.w3schools.com/html/html5_form_input_types.asp
Also worth noting is that the “placeholder” attribute you are using in the INPUT form field is not supported for the “date” type as best I can tell: http://www.w3schools.com/html5/att_input_placeholder.asp
From that page “Note: The placeholder attribute works with the following input types: text, search, url, tel, email, and password.”
I’ve double checked the code for the latest version 0.9.1 and there is no way that Month/Day/Year is a valid placeholder from this plugin. If you didn’t edit anything in the database or plugin then right now I’m at a loss to understand what is going on.
Can you try it with a fresh install of the plugin?
Do you have WordPress set up in any custom way?
What is your default date format in the standard settings?
Also what version of php do you use.
None of these things give me much hope because none of them should change the plugin output.
I just edited my last post to include what I discovered a couple minutes ago. Hope that helps.
Really appreciate your attention and support.
OK thanks. I don’t use chrome so didn’t know about this – now that I have something to go on I’ll see about stopping the native date-picker re-formatting issue.
I guess two workarounds are a) don’t use Chrome and b) remove the type=”date” setting yourself, pending an update.
After looking into this a bit it seems that Chrome is not playing nice. They’ve changed the picker to pick up the local date format as you saw (via the placeholder text). That’s fine. You should have been able to enter dates in that format instead – if you leave the plugin date setting as the default YYYY-MM-DD – since this should always be the submitted format of the UI picker according to the standard. So it should still work, but you are loosing the century so something is wrong.
Did you enter the date as Chrome wanted? (Month/Day/Year) Did it work for dates after 1900? Does it strip the century only for dates not starting 20 and 19. I expect dates like 1825-01-01 make Chrome unhappy.
I think that I will update the plugin and remove the type=”date” marker because date pickers in general seem to not like early dates (e.g. dates like 0870-12-10 seem to freak them out). It seems a shame to remove this functionality so I’ll revisit it later once FF has native date picker support and I can see the results.
I appreciate the time you’ve spent looking into this. Using Chrome I can enter the date in the format 0870-10-24 or 10/24/0870 and it is stored in the database appropriately.
If I edit that event it is displayed as “10/24/70”:
The good news is that it does work as long as the user corrects the two-digit year each time they perform an edit.
It is unfortunate but at the current time proper browser support for the date type of the INPUT tag is weak. There isn’t a huge benefit to using it so reverting to the text type until at least Firefox fully supports it sounds like a reasonable compromise.
I’ll just use Safari for now (since I’m on a Mac).
Thanks again for creating this plugin!
- The topic ‘Event Date Format Hides Century’ is closed to new replies.