Home Forums Plugin Support WP User Frontend Pro Date Picker

This topic is: not resolved

This topic contains 7 replies, has 2 voices, and was last updated by  towhid 4 years, 7 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #30168

    robbie59
    Participant
    Post count: 8

    Hello, Great plugin!

    I need to use the Frontend Pro date picker to pass unix time to the database. But Id still like the user to see the date selected in a human formant i.e. 12/12/14

    The reason I need this is because Im using EventON Calendar plugin and their custom field for the start_date is in Unix code.

    How can I achieve this with Frontend Pro?

    Thanks

    #30182

    robbie59
    Participant
    Post count: 8

    How can I use this action hook, function…..?

    // CREATE UNIX TIME STAMP FROM DATE PICKER
    function custom_unixtimesamp ( $post_id ) {
    if ( get_post_type( $post_id ) == ‘events' ) {
    $startdate = get_post_meta($post_id, ‘startdate', true);

    if($startdate) {
    $dateparts = explode(‘/', $startdate);
    $newdate1 = strtotime(date(‘d.m.Y H:i:s', strtotime($dateparts[1].'/'.$dateparts[0].'/'.$dateparts[2])));
    update_post_meta($post_id, ‘unixstartdate', $newdate1 );
    }
    }
    }
    add_action( ‘save_post', ‘custom_unixtimesamp', 100, 2);

    #30184

    towhid
    Participant
    Post count: 4505

    Hello Robbie59,

    Please type single character ‘y' then it will work. Please let me know if you have any complexity.

    Thank You. ๐Ÿ™‚

    #30185

    robbie59
    Participant
    Post count: 8

    Thanks, but that did not work.

    When I use the date field,with meta value as “start_date” I get this: 2014/11/25 00:00:00

    I need the date to converted to unix date.
    Something like this: 1416531600

    I need this to work really bad

    #30187

    robbie59
    Participant
    Post count: 8

    Are you talking about the hook? I never got that to work..

    #30193

    towhid
    Participant
    Post count: 4505

    Hello Robbie59,

    From the back-end please type single character “dd/mm/y” in Date Format field hope it will work. Please let me know if you have any complexity.

    Thank You. ๐Ÿ™‚

    #30228

    robbie59
    Participant
    Post count: 8

    Thanks,

    I did your suggestion and the format printed as 11/20/14.

    I need it so save to the database in unix format. i.e.: Something like this: 1416531600

    #30263

    towhid
    Participant
    Post count: 4505

    Hello Robbie,

    Currently we do not have any function in unix format. But you can do you own, Please follow this manual http://php.net/manual/en/function.date.php.

    Thank You. ๐Ÿ™‚

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Date Picker’ is closed to new replies.