Skip to content

Commit ed32016

Browse files
committed
fix(date): format dates for target generation
fix #1050 Signed-off-by: btry <tbugier@teclib.com>
1 parent 1ac0e07 commit ed32016

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

inc/fields/datefield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public function getValue() {
6767
return (strtotime($date) != '') ? $date : null;
6868
}
6969

70+
public function prepareQuestionInputForTarget($input) {
71+
return Toolbox::addslashes_deep(Html::convDate($input));
72+
}
73+
7074
public function getAnswer() {
7175
return Html::convDate($this->getValue());
7276
}

inc/fields/datetimefield.class.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public function getAnswer() {
7171
return Html::convDateTime($this->getValue());
7272
}
7373

74+
public function prepareQuestionInputForTarget($input) {
75+
return Toolbox::addslashes_deep(Html::convDateTime($input));
76+
}
77+
7478
public function isValid($value) {
7579
// If the field is required it can't be empty
7680
if ($this->isRequired() && (strtotime($value) == '')) {

0 commit comments

Comments
 (0)