summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/Core/DateParser.php6
-rw-r--r--app/Validator/TaskValidator.php2
2 files changed, 3 insertions, 5 deletions
diff --git a/app/Core/DateParser.php b/app/Core/DateParser.php
index b9aa9230..5d3be644 100644
--- a/app/Core/DateParser.php
+++ b/app/Core/DateParser.php
@@ -292,11 +292,9 @@ class DateParser extends Base
{
foreach ($fields as $field) {
if (! empty($values[$field])) {
- if (! ctype_digit($values[$field])) {
- $values[$field] = strtotime($values[$field]);
+ if (ctype_digit($values[$field])) {
+ $values[$field] = date($format, $values[$field]);
}
-
- $values[$field] = date($format, $values[$field]);
} else {
$values[$field] = '';
}
diff --git a/app/Validator/TaskValidator.php b/app/Validator/TaskValidator.php
index e3b0eded..e824dc05 100644
--- a/app/Validator/TaskValidator.php
+++ b/app/Validator/TaskValidator.php
@@ -42,7 +42,7 @@ class TaskValidator extends BaseValidator
new Validators\MaxLength('title', t('The maximum length is %d characters', 200), 200),
new Validators\MaxLength('reference', t('The maximum length is %d characters', 50), 50),
new Validators\Date('date_due', t('Invalid date'), $this->dateParser->getParserFormats()),
- new Validators\Date('date_started', t('Invalid date'), $this->dateParser->getParserFormats()),
+ new Validators\Date('date_started', t('Invalid date'), array($this->dateParser->getUserDateTimeFormat())),
new Validators\Numeric('time_spent', t('This value must be numeric')),
new Validators\Numeric('time_estimated', t('This value must be numeric')),
);