Giter Site home page Giter Site logo

Comments (10)

soderlind avatar soderlind commented on August 27, 2024

Thank you for the feedback, I'll look into this.

from acf-field-date-time-picker.

soderlind avatar soderlind commented on August 27, 2024

@ArnoldR can you please test again. In 2.0.7, with date format mm/dd/yy, create a new post, save it. Change the date format to dd/mm/yy and re-open the post in the editor.

I did this myself and 04/24/2013 became 24/04/2013.

Prior to 2.0.6, date was saved in the same format as you set it in add new field (e.g 24.04.2013), from 2.0.6 it's saved as a timestamp (eg 1366761600).

If you, prior to 2.0.6, save the date, upgraded to 2.0.7, changed the date format from mm/dd/yy to dd/mm/yy and opened the post in the editor, you might get the error you described above.

from acf-field-date-time-picker.

ArnoldR avatar ArnoldR commented on August 27, 2024

@soderlind I just did the test and, as you say, the 04/24/2013 became 24/04/2013 but if you click a second time on the update button of the post (without selecting an other date, just click to update the post), the date disappears.

If you want, I can send you a login/pwd on my wordpress to make some tests. Maybe we have different configurations.

from acf-field-date-time-picker.

soderlind avatar soderlind commented on August 27, 2024

@ArnoldR I don't need access to your site, I got the same error. I'll look into it.

from acf-field-date-time-picker.

ArnoldR avatar ArnoldR commented on August 27, 2024

Thank you. As I wrote above, if you choose a day between 1 and 12, example 10 April 2013, 04/10/2013 became 10/04/2013, update the post -> 04/10/2013, update again : 10/04/2013, etc... if this could help you.
Good luck !

from acf-field-date-time-picker.

soderlind avatar soderlind commented on August 27, 2024

From http://php.net/manual/en/function.strtotime.php

    Note:

    Dates in the m/d/y or d-m-y formats are disambiguated by looking at the separator between the various components: if the separator is a slash (/), then the American m/d/y is assumed; whereas if the separator is a dash (-) or a dot (.), then the European d-m-y format is assumed.

    To avoid potential ambiguity, it's best to use ISO 8601 (YYYY-MM-DD) dates or DateTime::createFromFormat() when possible.

So, in Europe we should use dd.mm.yy, but I'll write a fix in case people forget.

from acf-field-date-time-picker.

soderlind avatar soderlind commented on August 27, 2024

Fixed, will commit later today when I'm on a stable network (on a 3 hour bus ride now)

from acf-field-date-time-picker.

ArnoldR avatar ArnoldR commented on August 27, 2024

Ok thank you !

Before you commit, I would like add a case maybe to integrate in your update :
When you choose "D mm/dd/yy" instead of "mm/dd/yy", the "D" should display (for me, in French) : lun, mar, mer, jeu, ven, sam, dim before the date. -> It was ok with 2.0.5.

With 2.0.7, when we change "mm/dd/yy" to "D mm/dd/yy", the post already saved in "04/29/2013" becomes "Mon 04/29/2013" (ok, Mon = Monday) BUT if I click on the Datepicker to choose a date, the language is French, and the value of the field becomes in French too, example "Lun 04/29/2013" (Lun=Lundi=Monday in French), and when we valid the post, the value disappears completely. It seems to be a problem of translation, maybe not linked with your plugin, I don't know. Or maybe we can't use all the letters defined on http://docs.jquery.com/UI/Datepicker/formatDate
like "D", "M", etc... but with the version 2.0.5 this worked very well.

Thanks

from acf-field-date-time-picker.

soderlind avatar soderlind commented on August 27, 2024

Please test v2.0.8, it adds an option to store the date and time field as a UNIX timestamp or not.

from acf-field-date-time-picker.

ArnoldR avatar ArnoldR commented on August 27, 2024

Thank you for this option, it works on my side.

from acf-field-date-time-picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.