• Resolved Jae

    (@linseyja)


    Hello,
    I have passed the booking form data from my Calendly booking system into a custom Confirmation page. But it sends the Start Date of the client’s booking in a weird format

    event_start_time=2022-08-19T11%3A40%3A00%2B01%3A00

    I was hoping to use your plugin to reformat this into a more intelligible, easier-to-read format for display. But I cannot see how to do this. (Your documentation/instructions for using this plugin are not especially comprehensive, if I’m to be honest.)

    Can you please advise me if this is possible and, if so, how do I do it?

    And, just so you know, I am using another plugin called URL Params to get the URL parameters with a short code. Can I combine the short code from the URL Params plugin with one of the short codes from this WPDT plugin to produce a readable format for the date?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Denra.com

    (@denra)

    Hello @linseyja,

    The plugin does not support this feature but you can use your own code.

    For example:

    add_shortcode( 'wpdts-url-parameter', 'wpdts_url_parameter' );
    function wpdts_url_parameter( $atts ) {
         $date_any_string = filter_input( INPUT_GET, $atts['url_parameter'], FILTER_SANITIZE_STRING );
         return date("Y-m-d H:i:s", $date_any_string ? strtotime( $date_any_string ) : strtotime( current_time( 'mysql', false ) ) );
    }

    Then use a shortcode like this to display the date and time:

    [wpdts-url-parameter url_parameter="event_start_time"]

    where the url_parameter is used to set the name of the parameter to get for displaying (in your case event_start_time).

    For example:
    https://www.yourwebsite.com/somepage/?event_start_time=2022-08-19T11%3A40%3A00%2B01%3A00

    Please replace the date and time format in the function (Y-m-d H:i:s) with any format you want according to this page:
    https://www.php.net/manual/en/datetime.format.php

    Note: If no date and time parameter is set the current date and time are displayed.

    • This reply was modified 1 year, 9 months ago by Denra.com.
    Plugin Author Denra.com

    (@denra)

    This thread will be closed.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Format Date Taken From URL Parameter’ is closed to new replies.