Support » Plugin: AM Events » Custom Date format conflict

  • Resolved nvvweb

    (@nvvweb)


    I have a japanese website on which I am using the AM Events plugin. Because the site is for a Japanese audience, I’ve set a custom date format in the General settings for the site as Y年m月d日, which works great throughout the site for front-end presentation.

    However, when using the calendar date picker on an AM Event in the dashboard, that custom format conflicts with the plugin and gets saved as “Jan 1, 1970” as a default date because the text inserted is not recognizable to the AM Event code. Is there any way to address this issue or are we just going to need to not use the calendar date picker?

    Many thanks for a useful plugin!

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Atte Moisio

    (@moisture)

    Hey,

    I tried this and first I couldn’t reproduce this but I think I just realized what the problem might be.

    The plugin doesn’t actually use the date format defined in the WordPress settings for the date picker. Instead, it uses a date format defined in the translation files. So I’m betting you have translated the plugin and used the same value Y年m月d日 or similar in your translation file.

    You’ll find the translation under key “m/d/Y H:i” (which is also the default value). This should be set to a format that can be understood by PHP strtotime function. Changing this translation value won’t have affect anything else but the datetime picker.

    Hope this helps and thanks for using the plugin!

    • This reply was modified 2 years, 2 months ago by  Atte Moisio.

    Thank you for looking into a solution. There does seem to be a translation file that was loaded for Japanese (I’m using the Loco Translate plugin), but none of the values have been translated. There seems to be something strange with the po file – it’s not allowing translations – so I’ll look further into it and see if I can sort out a fix and apply your suggestion. If it doesn’t work, then we can live with just manually entering the dates instead of using the calendar date picker.

    Thanks again for your help!

    Plugin Author Atte Moisio

    (@moisture)

    Any chance you figured out what the problem was? There’s another user struggling with the same issue atm.

    • This reply was modified 2 years, 1 month ago by  Atte Moisio.

    No, I didn’t find a fix. I got the translation file sorted out but even manually creating a japanese file and inserting english for the “translation value” didn’t make any difference. If I were going to pursue it further, I probably would have started looking at the translation files for the plugins I am using…but if I recall, I did do a quick search in each of those for “m/d/Y H:i” and turned up nothing to conflict.

    Plugin Author Atte Moisio

    (@moisture)

    I’ve just updated the plugin with a completely new date time picker (switched from jQuery based datetimepicker to flatpickr). The time formatting should also behave better now.

    nvvweb

    (@nvvweb)

    Thank you for continuing to follow up on this issue, Atte. It’s really not a problem for us to work around, but I did update to test whether it fixed things for us. Now I’m not seeing any datepicker at all…which is probably not what you wanted to hear 🙂 That may actually end up being okay for us, but I wanted to let you know in case others experience a problem with the new version as well.

    Plugin Author Atte Moisio

    (@moisture)

    Thanks for trying it out. Could you specify what browser and WordPress version you are using?

    nvvweb

    (@nvvweb)

    WP 4.8.2
    Chrome Browser with a javascript error in the plugin’s admin-post.js file “cannot read property ‘regional’ of undefined”

    I took a screenshot of the error for you, but I don’t see a place to upload here, so hopefully the info above will get you to the necessary line of code.

    Plugin Author Atte Moisio

    (@moisture)

    That js file has been completely re-written. The row with the error you encountered does not exist anymore. This might be a caching issue.

    nvvweb

    (@nvvweb)

    Perfect! I dumped cache and tested it again – dates are normal now. Thanks again for your persistence.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Custom Date format conflict’ is closed to new replies.