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
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.