Support » Plugin: Custom Blocks Constructor - Lazy Blocks » Date Field Not Outputting Chosen Date

  • Resolved Clayton Chase

    (@claytonchase)


    I’ve followed the documentation exactly and no matter what I do the date and time field only outputs todays date. Any help on getting this working would be great.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author nK

    (@nko)

    Hi.

    I don’t see any problems with the date control. Please, provide some more info, so I can try to reproduce this issue.

    Regards, nK.

    Thread Starter Clayton Chase

    (@claytonchase)

    Hey,

    I’ve attached screenshots of what is happening. Essentially, I’m using the PHP output method but no matter what date I choose in the block todays date gets output.

    Screenshote

    Quick Loom video as well: https://www.loom.com/share/20b4cb1d30904f2f8023c9a6a5e0cfe6

    Thank you!

    Plugin Author nK

    (@nko)

    Aha, understand now. Need to use strtotime function. Example:

    echo date_i18n( 'F j, Y', strtotime( $attributes['control_name'] ) );
    
    Thread Starter Clayton Chase

    (@claytonchase)

    That worked like a charm! Thanks for taking a look. I got that original code from you documentation so that might need to be included there for future reference. Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Date Field Not Outputting Chosen Date’ is closed to new replies.