Support » Plugin: Post Meta Controls » date in the past?

  • Resolved cjyabraham

    (@cjyabraham)


    Hi,
    I am using the date_single type but I’m finding I’m only able to set a date in the future, even if I key in the date by hand rather than use the date picker control. Is it possible to set to a date in the past?

    Thanks,
    Chris

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Alvaro

    (@melonpan)

    Hi Chris,

    Im afraid currently it is not possible to set a past date.
    Im taking note of it, to give more flexibility in the date control options for a future version.

    Thanks,
    Álvaro

    Cool. Thanks. For now I’ll just use a text field 🙂

    Plugin Author Alvaro

    (@melonpan)

    I included a related option, which should give more control, in the next version (the current rc can be downloaded here).

    In both date_single and date_range a new option ‘unavailable_dates’ can be passed composed of an array of start, end dates. There is also the option to include ‘before’ and ‘after’. For example:

    
    'unavailable_dates' => array(
    	array( 'before', '5/10/2019' ),
    	array( '10/10/2019', '15/10/2019' ),
    	array( '20/10/2019', 'after' ),
    ),
    

    I’ll release a page with all the documentation next week.

    cjyabraham

    (@cjyabraham)

    Sounds good. Will dates in the past work as well?

    Plugin Author Alvaro

    (@melonpan)

    I just made some tweaks which are not in the rc, so its better to wait until the final release.

    Sure, you can just set unavailable range of dates. The default is ['before', 'today'], but these can be adapted to include a specific date, for example ['1/12/2019', '15/12/2019'] or ['1/12/2019', 'after']. If you want to include any day as available simply pass an empty array so there are no unavailable dates.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘date in the past?’ is closed to new replies.