From 2b4451cdac85582f1bb82cd74162eb537031f424 Mon Sep 17 00:00:00 2001 From: Indy Griffiths <32345766+indygriffiths@users.noreply.github.com> Date: Fri, 21 Sep 2018 15:58:19 +1200 Subject: [PATCH] FIX DefaultToToday date format Fixes incorrectly using the minute (m) instead of the month (M) and switches to showing an 2018-09-21 format value --- code/Model/EditableFormField/EditableDateField.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/Model/EditableFormField/EditableDateField.php b/code/Model/EditableFormField/EditableDateField.php index d8cf23e..70d790c 100755 --- a/code/Model/EditableFormField/EditableDateField.php +++ b/code/Model/EditableFormField/EditableDateField.php @@ -55,7 +55,7 @@ class EditableDateField extends EditableFormField public function getFormField() { $defaultValue = $this->DefaultToToday - ? DBDatetime::now()->Format('Y-m-d') + ? DBDatetime::now()->Format('yyyy-MM-dd') : $this->Default; $field = FormField::create($this->Name, $this->Title ?: false, $defaultValue)