Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

DateTime/datepicker format problems

Go to End

15 Posts   4953 Views


Community Member, 187 Posts

17 March 2012 at 12:33am

That obviously suggests that it's a problem specific to the beta, but I couldn't find anything to suggest that the DateField class has been altered at all.

Is the beta using a different version of JQuery or anything? I'm starting to think that it might be a javascript issue


Forum Moderator, 1890 Posts

17 March 2012 at 11:39pm

I've not started to use SS3 yet, your best bet is to ask on the dev list..!forum/silverstripe-dev

or raise a bug on...


Community Member, 13 Posts

19 March 2012 at 4:18am

SilverStripe v2.4

Need to change the date formatting mask. This solution is for many languages.

1. Open file "sappire\core\model\fieldtypes\Date.php"
2. Replace function "date" and formatting mask with strftime function (see more
3. Open your "_config.php" file and add this string: setlocale(LC_TIME,''); or setlocale(LC_TIME, 'your_LOCAL');


Forum Moderator, 1307 Posts

3 July 2012 at 12:31am

I ran into this issue using version 3.0.0 stable, so I thought I'd share. Example: Dutch locale (nl):

first you set something like this in your getCMSFields()

$fields->addFieldToTab('Root.MyTab', $date = new DateField('Date', 'MyDate'));
$date->setConfig('showcalendar', true);
$date->setConfig('jslocale', 'nl');

Next you need to have a regional file be present for the desired language. At the moment these are not (yet) included in the SilverStripe distribution. Get them here:

SilverStripe expects this file to live in /framework/thirdparty/jquery-ui/minified/i18n/jquery.ui.datepicker-nl.min.js (note the .min in the name)

Ticket here:



Community Member, 6 Posts

6 July 2012 at 5:43pm

Is it possible to show the datepicker in my gridfield?
I use it in my eventgrid and when i add new entry and jumping to the input mask picker is not working.
Some ideas how to solve this problem?


Community Member, 244 Posts

18 October 2012 at 3:04pm


I just had similar issues - wrong date format swapping dates and months....
you have to turn set the datefeild config to show, and to use dd-MM-yyyy

class Event extends DataObject {
  public static $db = array(		 
	  'Title' => 'Varchar',
	  'Date' => 'Date',
	  'Details' => 'HTMLText',
  public function getCMSFields() {
		DateField::set_default_config('showcalendar', true);
 		$fields = parent::getCMSFields();
		return $fields;		


Community Member, 470 Posts

19 October 2012 at 2:20pm

My issue isn't the exact same, but it is an issue with the calendar picker.

If the calendar picker field is required, I'm finding when I pick the date with the jquery calendar, it fills the field in fine, but when I go to submit the form the JS validation says that the form is required and needs to be filled out.

Has anybody experienced this before? I've had clients tell me the same and I can replicate it.

I'm just using the userforms module, and setting the date in my config file as i18n::set_date_format('dd/MM/YYYY');

Go to Top