WordPress.org

Ready to get started?Download WordPress

Forums

  1. thisismyalterego
    Member
    Posted 1 year ago #

    Hey there,
    when I am using the "custom fields" option in the backend and I am using the "jquery date picker" it always have a pre-defined date-format like Month dd, yyyy
    Also it's not accepting the date-format I am using. In Germany we use dd.mm.YYY and this is how my WP is set up.

    Is there a possibility to change this?

    http://wordpress.org/extend/plugins/types/

  2. Magenta Cuda
    Member
    Posted 1 year ago #

    If you are willing to modify the types source code try this:

    Change in file types\embedded\classes\validation-cakephp.php lines 428-432 and file types\embedded\common\classes\validation-cakephp.php lines 429-433

    FROM:
    
            $cake_date_formats = array('F j, Y' => 'Mdy',
                'Y/m/d' => 'ymd',
                'm/d/Y' => 'mdy',
                'd/m/Y' => 'dmy'
            );
    
    TO:
    
            $cake_date_formats = array('F j, Y' => 'Mdy',
                'Y/m/d' => 'ymd',
                'm/d/Y' => 'mdy',
                'd/m/Y' => 'dmy',
                'd.m.Y' => 'dmy'
            );

    and file types\embedded\includes\fields\date.php lines 3-13

    FROM:
    
    $supported_date_formats = array('F j, Y', //December 23, 2011
        'Y/m/d', // 2011/12/23
        'm/d/Y', // 12/23/2011
        'd/m/Y' // 23/22/2011
    );
    
    $supported_date_formats_text = array('F j, Y' => 'Month dd, yyyy',
        'Y/m/d' => 'yyyy/mm/dd',
        'm/d/Y' => 'mm/dd/yyyy',
        'd/m/Y' => 'dd/mm/yyyy'
    );
    
    TO:
    
    $supported_date_formats = array('F j, Y', //December 23, 2011
        'Y/m/d', // 2011/12/23
        'm/d/Y', // 12/23/2011
        'd/m/Y', // 23/22/2011
        'd.m.Y'  // 23.12.2011
    );
    
    $supported_date_formats_text = array('F j, Y' => 'Month dd, yyyy',
        'Y/m/d' => 'yyyy/mm/dd',
        'm/d/Y' => 'mm/dd/yyyy',
        'd/m/Y' => 'dd/mm/yyyy',
        'd.m.Y' => 'dd.mm.yyyy'
    );

    Also when defining the field you must NOT check the Validation Date checkbox. The validation routines currently does not support period separators.

  3. thisismyalterego
    Member
    Posted 1 year ago #

    cool!
    Thank you :)

    (sorry for the late response)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags