Support

Account

Home Forums Front-end Issues Manipulating datepicker data Reply To: Manipulating datepicker data

  • Hi @petehawk

    Can you elaborate more on what your mean by:
    Can I, using the entered data (DyyMd), “reconstruct” it as yymmdd and use that in the get_posts function?

    Basically, for the get_posts function to query or sort based on a date picker value, it must be a numeric value in the JS date_format of ‘yymmdd’. This may not be the answer you want to here, but it is the reality.

    If you could change the format and re-save your posts, the the query will work.
    There is a way to get the day of week from the format yymmdd.

    If you have a look at the docs:
    http://www.advancedcustomfields.com/resources/field-types/date-picker/

    You will see that an example uses a create from format function and contains a modify function for the output. You can read up on the PHP docs for modify, but I know there is a string output which will get the day of week.

    Hope that helps.

    Thanks
    E