From 4df5d0d0fbeac7d713ebcacbe1a89ab59aeb2801 Mon Sep 17 00:00:00 2001 From: Philippe Lonchampt Date: Fri, 14 Sep 2018 14:39:11 +0200 Subject: [PATCH] Fix date format --- bower.json | 2 +- .../Repositories/AutoUpdater/Valuators/DateValuator.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/bower.json b/bower.json index f01dda0..88c820b 100644 --- a/bower.json +++ b/bower.json @@ -1,5 +1,5 @@ { - "name": "Sharp", + "name": "sharp", "version": "3.0.0", "dependencies": { "bootstrap": "~3.3.0", diff --git a/src/Dvlpp/Sharp/Repositories/AutoUpdater/Valuators/DateValuator.php b/src/Dvlpp/Sharp/Repositories/AutoUpdater/Valuators/DateValuator.php index 4a93a32..efd3266 100644 --- a/src/Dvlpp/Sharp/Repositories/AutoUpdater/Valuators/DateValuator.php +++ b/src/Dvlpp/Sharp/Repositories/AutoUpdater/Valuators/DateValuator.php @@ -41,6 +41,11 @@ function __construct($instance, $attr, $data) */ public function valuate() { + // Workaround to remove unwanted part of the iso date format + // added by browser + if($pos = strpos($this->data, "(")) { + $this->data = substr($this->data, 0, $pos); + } $value = date("Y-m-d H:i:s", strtotime($this->data));