WordPress.org

Ready to get started?Download WordPress

Forums

This Day In History
[resolved] Event Date Format Hides Century (10 posts)

  1. fhwporg
    Member
    Posted 1 year ago #

    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

    http://wordpress.org/extend/plugins/this-day-in-history/

  2. BC
    Member
    Plugin Author

    Posted 1 year ago #

    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?

  3. fhwporg
    Member
    Posted 1 year ago #

    The only plugins I had installed were:

    • W3 Total Cache
    • WordPress SEO by Yoast
    • WordPress Importer
    • Akismet
    • Jetpack
    • WooDojo

    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.

    Looks exactly the same as before:
    tdih-screencap1.png
    tdih-screencap2.png

    WordPress v3.5.0
    Athena Theme 1.0.4 using WooFramework 5.5.3

  4. fhwporg
    Member
    Posted 1 year ago #

    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."

  5. BC
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  6. fhwporg
    Member
    Posted 1 year ago #

    I just edited my last post to include what I discovered a couple minutes ago. Hope that helps.

    Really appreciate your attention and support.

  7. BC
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  8. BC
    Member
    Plugin Author

    Posted 1 year ago #

    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.

  9. fhwporg
    Member
    Posted 1 year ago #

    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":
    tdih-screencap4

    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!

    Regards,
    Frank

  10. fhwporg
    Member
    Posted 1 year ago #

    I'm going to mark this as resolved since it is browser-related and not an issue with the TDIH plugin.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.