• Resolved pchlorenzo

    (@pchlorenzo)


    Hello and thank you in advance…

    I want to query from a list only the posts which meta key (“LIMIT”) with a “d/m/Y” format,
    to show only the posts which have LIMIT value in the days after today.

    Y have tried a lot of combinations, but only compares de day numbers, not the months or the year.

    Example:

    KEY(LIMIT) >= [w4pl_date format=’d/m/Y’]

    That combination shows the posts with the day bigger number over today’s number day. Even if the value is the last month or year.
    For example if today is 20/07/2016, the query show posts with 23/02/2016. Only compares the day number not the month or year.

    What will be the correct query

    Tank you

    Pablo

    https://wordpress.org/plugins/w4-post-list/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Shazzad Hossain Khan

    (@sajib1223)

    Hi,

    What you are trying to achieve wont work this way.

    20/07/2016 is equivalent to 20072016
    23/02/2016 is equivalent to 23022016.

    Second one is definitely bigger in text or interger comparison, and i think our plugin only cast the value as text or interger, not date.

    The problem can be solved by changing your date format to Y/m/d, you can try to create an extra custom field for that i guess.

    Or the other solution is to write your own custom query yourself.

    I think in future, i will add a option to set the comparison type, date or other formats.

    Thanks.

    Thread Starter pchlorenzo

    (@pchlorenzo)

    Hello, thank you very much.
    I changed the date format, and It worked fine for my purposes.

    It will be great if finally you are able to introduce a option to set the comparison type, date or other formats.

    😉 I’am happy.

    Pablo

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘META QUERY – dynamic value with meta key (date)’ is closed to new replies.