KYLIN-2297, Manually edit cube segment start/end time will throw error in UI
Signed-off-by: zhongjian <jiat...@163.com> Project: http://git-wip-us.apache.org/repos/asf/kylin/repo Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/5fd3c564 Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/5fd3c564 Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/5fd3c564 Branch: refs/heads/master-cdh5.7 Commit: 5fd3c56408050b1bb2a939bbb7b2105b4806aef8 Parents: 7446c56 Author: luguosheng <550175...@qq.com> Authored: Mon Dec 19 11:33:51 2016 +0800 Committer: zhongjian <jiat...@163.com> Committed: Mon Dec 19 13:54:36 2016 +0800 ---------------------------------------------------------------------- webapp/app/js/directives/directives.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kylin/blob/5fd3c564/webapp/app/js/directives/directives.js ---------------------------------------------------------------------- diff --git a/webapp/app/js/directives/directives.js b/webapp/app/js/directives/directives.js index f5051e8..bf1690c 100644 --- a/webapp/app/js/directives/directives.js +++ b/webapp/app/js/directives/directives.js @@ -278,10 +278,11 @@ KylinApp.directive('kylinPagination', function ($parse, $q) { }); ctrl.$parsers.push(function (value) { - if (isNaN(value)||value==null) { + if(/\d{4}-\d{1,2}-\d{1,2}\s+(\d{1,2}:\d{1,2}:\d{1,2})/.test(value)) { + value=new Date(value); + }else{ return value; } - //value = new Date(value.getFullYear(), value.getMonth(), value.getDate(), 0, 0, 0, 0); return value.getTime()-(60000 * value.getTimezoneOffset()); }); }