Datepicker FR DD/MM/YYYY

Datepicker FR DD/MM/YYYY

buroticaburotica Posts: 7Questions: 3Answers: 0

Hello,
I try to use with "Editor DataTables" the datepicker to French Format DD / MM / YYY. You will find below my code parrait me be good. But quans I select a date, it still adds me one more day.

ajax: "plan_parcellaire.php?format=custom",
        table: "#map",
        fields: [ 
            {   label: "Date : ", 
                name: "date",
                type: "datetime",
                def:   function () { return new Date(); },
                format: "DD/MM/YYYY"
            },
...
// Allow a number of different formats to be submitted for the various demos
$format = isset( $_GET['format'] ) ?
    $_GET['format'] :  '';

if ( $format == 'custom' ) {
    $update = 'd/m/Y';
}
else {
    $update = Format::DATE_ISO_8601;
}

// Build our Editor instance and process the data coming from _POST
Editor::inst( $db, 'map' )
     ->fields(
    Field::inst( 'date' )
            ->validator( 'Validate::dateFormat', array( 'empty' => false, 'format' => $update ) )
            ->getFormatter( 'Format::date_sql_to_format', $update )
            ->setFormatter( 'Format::date_format_to_sql', $update )
    )
    ->process( $_POST )
    ->json();

thanks for your help

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,180Questions: 1Answers: 10,411 Site admin
    Answer ✓

    Hi,

    Thanks for your question. Just to confirm the issue - if you were to select (for example) 1st December 2015, it would actually write 2nd December 2015 to the database?

    Could you confirm that you are using Editor 1.5.3 please? Also, are you able to link to the page you are working on that shows the issue? And finally, what time zone are you in?

    Thanks,
    Allan

  • buroticaburotica Posts: 7Questions: 3Answers: 0

    Outch, I had version 1.5.2.
    Sorry, I was sure to have the latest version
    Thank you

This discussion has been closed.