diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-02-06 18:08:41 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-02-06 18:08:41 -0500 |
commit | 58cef289674717027b6b470044504a661f3bd9ad (patch) | |
tree | bf3be866b414009b60b1e1f16480a84c91da03de /app/Model | |
parent | fc785bbbf6cc7db01964ae1d99cd02e85afeedc2 (diff) |
The date time format can be chosen in application settings
Diffstat (limited to 'app/Model')
-rw-r--r-- | app/Model/File.php | 2 | ||||
-rw-r--r-- | app/Model/TaskCreation.php | 5 | ||||
-rw-r--r-- | app/Model/TaskExport.php | 2 | ||||
-rw-r--r-- | app/Model/TaskModification.php | 5 |
4 files changed, 8 insertions, 6 deletions
diff --git a/app/Model/File.php b/app/Model/File.php index be62cdb3..46fc4bb9 100644 --- a/app/Model/File.php +++ b/app/Model/File.php @@ -308,7 +308,7 @@ class File extends Base */ public function uploadScreenshot($project_id, $task_id, $blob) { - $original_filename = e('Screenshot taken %s', dt('%B %e, %Y at %k:%M %p', time())).'.png'; + $original_filename = e('Screenshot taken %s', $this->helper->dt->datetime(time())).'.png'; return $this->uploadContent($project_id, $task_id, $original_filename, $blob); } diff --git a/app/Model/TaskCreation.php b/app/Model/TaskCreation.php index 975cc7a3..f7d981fa 100644 --- a/app/Model/TaskCreation.php +++ b/app/Model/TaskCreation.php @@ -49,8 +49,9 @@ class TaskCreation extends Base */ public function prepare(array &$values) { - $this->dateParser->convert($values, array('date_due')); - $this->dateParser->convert($values, array('date_started'), true); + $values = $this->dateParser->convert($values, array('date_due')); + $values = $this->dateParser->convert($values, array('date_started'), true); + $this->removeFields($values, array('another_task')); $this->resetFields($values, array('date_started', 'creator_id', 'owner_id', 'swimlane_id', 'date_due', 'score', 'category_id', 'time_estimated')); diff --git a/app/Model/TaskExport.php b/app/Model/TaskExport.php index 278c0897..ed179a4f 100644 --- a/app/Model/TaskExport.php +++ b/app/Model/TaskExport.php @@ -106,7 +106,7 @@ class TaskExport extends Base $task['score'] = $task['score'] ?: 0; $task['swimlane_id'] = isset($swimlanes[$task['swimlane_id']]) ? $swimlanes[$task['swimlane_id']] : '?'; - $this->dateParser->format($task, array('date_due', 'date_modification', 'date_creation', 'date_started', 'date_completed'), 'Y-m-d'); + $task = $this->dateParser->format($task, array('date_due', 'date_modification', 'date_creation', 'date_started', 'date_completed'), 'Y-m-d'); return $task; } diff --git a/app/Model/TaskModification.php b/app/Model/TaskModification.php index eee7b2e0..8e59b3fe 100644 --- a/app/Model/TaskModification.php +++ b/app/Model/TaskModification.php @@ -84,8 +84,9 @@ class TaskModification extends Base */ public function prepare(array &$values) { - $this->dateParser->convert($values, array('date_due')); - $this->dateParser->convert($values, array('date_started'), true); + $values = $this->dateParser->convert($values, array('date_due')); + $values = $this->dateParser->convert($values, array('date_started'), true); + $this->removeFields($values, array('another_task', 'id')); $this->resetFields($values, array('date_due', 'date_started', 'score', 'category_id', 'time_estimated', 'time_spent')); $this->convertIntegerFields($values, array('priority', 'is_active', 'recurrence_status', 'recurrence_trigger', 'recurrence_factor', 'recurrence_timeframe', 'recurrence_basedate')); |