Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter cankahya

    (@cankahya)

    I realized, that for some reason the special chars were encoded here…
    so the requested url is:

    
    https://[MYDOMAIN]/wp-json/wp/v2/[CPT]?filter[meta_key]=datum&filter[meta_value]=2018-07-15&filter[meta_compare]=>&per_page=100
    
    Plugin Author sk8tech

    (@sk8tech)

    @cankahya Thank you for your message. We see a couple of things that could cause this.

    Can you please send us your WPAdmin login privately, to [email protected]. We’ll have a look for you ASAP.

    Thread Starter cankahya

    (@cankahya)

    Hi there, thanks for the quick reply! I just created your admin account. The WP generated mail should be in your inbox ??

    If you don’t find time to look into it now, could you provide some hints, so that I can start looking by myself?

    Cheers,

    Can

    Thread Starter cankahya

    (@cankahya)

    Sorry to bother you again, but I am really stuck in this… Any ideas where to look would help me a lot!
    Cheers,
    Can

    Plugin Author sk8tech

    (@sk8tech)

    @cankahya Just checked, we haven’t got your email yet. Can you please manually send it again?

    For this issue, it’s usually caused by Date format.

    When saved in MySQL DB, Date data should always be saved as the standard ISO8601 compliant format. See [WP REST HANDBOOK](https://developer.www.ads-software.com/rest-api/reference/posts/#list-posts) for more reference on this issue.

    If you wish to display the date user-friendly on the friend end, e.g. on your WordPress Website, or in your app, you should take the ISO8601 formatted Date from the backend, and sort it in the front end, and display it friendly. There is plenty front end lib which does that.

    For your issue specifically,
    1. Check if you are using ‘Date’ as ‘Feild Type’ in your ACF ‘Field’ datum settings. If so, ACF should have saved the date as the iOS8601 format in MySQL DB.
    2. Try filtering the date using iOS8691 format, so:
    https://[MYDOMAIN]/wp-json/wp/v2/%5BCPT%5D?filter%5Bmeta_key%5D=datum&filter%5Bmeta_value%5D=2018-12-27T23:59:59&filter%5Bmeta_compare%5D=>&per_page=100
    3. If it still doesn’t work, email us privately, we’ll get you sorted out.

    Plugin Author sk8tech

    (@sk8tech)

    Hi @cankahya, we’re yet to hear from you. Did you figure everything out?

    Thread Starter cankahya

    (@cankahya)

    Hi there,

    yeah, I am still working on it! The field is set as acf-date field and should be stored in ISO8601 format.

    I also realized, that the admin-sortable columns needed some adjustment in order for the sorting to work:I had to register orderby for the meta-field. Maybe it is similar with the compare? Well, I am on it!

    So, your help would still be appreciated a lot! I just sent you the link manually ??

    Cheers,
    Can

    Plugin Author sk8tech

    (@sk8tech)

    Hi, @cankahya

    We’ve logged into the dashboard, and had a look at your field settings. The only issue we think might be causing this is that

    In ‘Field’ Datum, for ‘Field Type’, we would have selected ‘Date Time Picker’, instead of ‘Date Picker’.

    Can you please change to that, re-save all existing CPTs, and then give it another try?

    Thank you.

    Thread Starter cankahya

    (@cankahya)

    Hi there,

    thank you for looking into it!

    I tried it with your suggestions and it seems to work! So the filter only works with ‘Date Time Picker’ and not with ‘Date Picker’, apparently.

    Is there a chance of making it work with the Date Picker as well?

    Otherwise I have to choose between:

    A)Letting my client being able to pick a time without it making sense

    B) setting up a custom REST Endpoint with a custom wp_query for the exact filter I want to use.

    Do you have another suggestions how to proceed?

    Anyhow: Thank you a lot for getting me out of being stuck in this! Great support, guys!!

    All the best,
    Can

    Plugin Author sk8tech

    (@sk8tech)

    @cankahya Hi,

    I imagine there should! But we need a few weeks to implement (Sorry a bit slow…).

    When do you need it by?

    Thread Starter cankahya

    (@cankahya)

    Hi there,

    no hurries, meanwhile I will just use a custom endpoint without the generic filter functionality.

    But I agree – it would do the plugin good, if it could perform such a query ??

    Thank you for you great support!

    Cheers,

    Can

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘ACF Date Field making trouble’ is closed to new replies.