Date Picker UK Format

Permalink 1 user found helpful
Hi

Been searching but I can't seem to locate the files that make up the Date Picker, on both ProNews & Extended Form when you use the date picker it shows up as the US format ie, m/d/y, could really do with it showing as d/m/y. Is the date picker part of the core or does each block have its own date picker and also how do I change this?

thanks in advance

 
firepixel replied on at Permalink Reply
firepixel
Old topic, but I keep forgetting how to do this so... we add the following to the config/site.php file...

define('DATE_APP_GENERIC_MDYT_FULL', 'F d, Y \a\t g:i A');
define('DATE_APP_GENERIC_MDYT', 'j/n/Y \a\t g:i A');
define('DATE_APP_GENERIC_MDY', 'j/n/Y');
andrew replied on at Permalink Reply
andrew
If you use the very latest code in github, there are a couple bugs fixed with non-US dates and the calendar date picker we use. There are more details in this post:

http://www.concrete5.org/community/forums/customizing_c5/non-us-dat...

Basically, you'll want to include another constant, and make sure you use d-m-Y instead of d/m/Y
firepixel replied on at Permalink Reply
firepixel
Humm, just realised none of the solutions seems to work with the built in form function.

Solution is to (ignore my previous post and...) manually code the input as so...

<input name="date" type="text" class="datepicker" value="<?php echo Date('d-m-Y') ?>"/>


and then manually set the format using jQuery...

<script>
$('.datepicker').datepicker({dateFormat: 'dd-mm-yy'})
</script>
simoneast replied on at Permalink Reply
simoneast
As I mentioned inhttp://www.concrete5.org/index.php?cID=113666...

In concrete 5.7.5.2 the datepicker() format used in custom forms appears to (sadly) be hard-coded in /concrete/src/Form/Service/Widget/DateTime.php.

The only way I found to change it was to inject the following Javascript into the bottom of my theme template:

$('.ccm-input-date.hasDatepicker').datepicker('option', 'dateFormat' ,'d M yy');