{"action":"opened","issue":{"url":"https://api.github.com/repos/RubyLouvre/avalon.oniui/issues/609","labels_url":"https://api.github.com/repos/RubyLouvre/avalon.oniui/issues/609/labels{/name}","comments_url":"https://api.github.com/repos/RubyLouvre/avalon.oniui/issues/609/comments","events_url":"https://api.github.com/repos/RubyLouvre/avalon.oniui/issues/609/events","html_url":"https://github.com/RubyLouvre/avalon.oniui/issues/609","id":70750290,"number":609,"title":"datepicker组件开启timer时，设置duplex时间为'yyyy-MM-dd hh:mm'，时间显示错误","user":{"login":"animabear","id":2759195,"avatar_url":"https://avatars.githubusercontent.com/u/2759195?v=3","gravatar_id":"","url":"https://api.github.com/users/animabear","html_url":"https://github.com/animabear","followers_url":"https://api.github.com/users/animabear/followers","following_url":"https://api.github.com/users/animabear/following{/other_user}","gists_url":"https://api.github.com/users/animabear/gists{/gist_id}","starred_url":"https://api.github.com/users/animabear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/animabear/subscriptions","organizations_url":"https://api.github.com/users/animabear/orgs","repos_url":"https://api.github.com/users/animabear/repos","events_url":"https://api.github.com/users/animabear/events{/privacy}","received_events_url":"https://api.github.com/users/animabear/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-24T17:41:26Z","updated_at":"2015-04-24T17:41:26Z","closed_at":null,"body":"RT, 比如设置deplex对应的值为‘2015/04/25 01:00'，最终显示的时间为‘2015/04/25 01:00 01:35'，拼接了现在的时间。代码如下：\r\n```javascript\r\nif (vmodel.timer) {\r\n    vmodel.width = 100\r\n    if (_initValue && validateDate(_initValue)) {\r\n        _initValue = _initValue + \" \" + vmodel._getNow()\r\n    }\r\n}\r\n```\r\n我做了如下修改（validateTimer参考validateDate，增加判断是否含有 '：' 的逻辑）：\r\n```javascript\r\n// 检验开启timer时的date\r\nfunction validateTimer(date) {\r\n    if (typeof date == \"string\") {\r\n        return ~date.indexOf(':') ?\r\n               false :\r\n               parseDate(date);\r\n    } else {\r\n        return date;\r\n    }\r\n}\r\n...\r\nif (vmodel.timer) {\r\n    vmodel.width = 100\r\n    if (_initValue && validateTimer(_initValue)) {\r\n        _initValue = _initValue + \" \" + vmodel._getNow()\r\n    }\r\n}\r\n```"}}