{"action":"created","issue":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/1385","repository_url":"https://api.github.com/repos/ant-design/ant-design","labels_url":"https://api.github.com/repos/ant-design/ant-design/issues/1385/labels{/name}","comments_url":"https://api.github.com/repos/ant-design/ant-design/issues/1385/comments","events_url":"https://api.github.com/repos/ant-design/ant-design/issues/1385/events","html_url":"https://github.com/ant-design/ant-design/issues/1385","id":147354176,"number":1385,"title":"建议：关于DatePicker的返回值统一问题。","user":{"login":"outrace","id":712424,"avatar_url":"https://avatars.githubusercontent.com/u/712424?v=3","gravatar_id":"","url":"https://api.github.com/users/outrace","html_url":"https://github.com/outrace","followers_url":"https://api.github.com/users/outrace/followers","following_url":"https://api.github.com/users/outrace/following{/other_user}","gists_url":"https://api.github.com/users/outrace/gists{/gist_id}","starred_url":"https://api.github.com/users/outrace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/outrace/subscriptions","organizations_url":"https://api.github.com/users/outrace/orgs","repos_url":"https://api.github.com/users/outrace/repos","events_url":"https://api.github.com/users/outrace/events{/privacy}","received_events_url":"https://api.github.com/users/outrace/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-04-11T08:32:37Z","updated_at":"2016-04-11T08:58:15Z","closed_at":null,"body":"当表单上有一个DatePicker，用户点击选择了日期后。\r\nthis.props.form.validateFields((errors, values)\r\n返回的values。其类型是Date类型\r\n\r\n当使用this.props.form.setFieldsValue 设置DatePicker的value ：'2016-04-01'\r\n（  format=\"yyyy-MM-dd\"）。可以正常显示。\r\n但是这时候直接调用\r\nthis.props.form.validateFields((errors, values)   返回的是string类型的‘2016-04-01’。\r\n但是如果用户点击表单，更改这个DatePicker的值  返回的就又会是Date类型\r\n\r\n建议：\r\n无论是setFieldsValue的时候，设置的是Date类型还是String类型。\r\n\r\nDatePicker统一返回一种类型（Date类型或者String类型，个人建议都返回符合format格式的String类型）。"},"comment":{"url":"https://api.github.com/repos/ant-design/ant-design/issues/comments/208239163","html_url":"https://github.com/ant-design/ant-design/issues/1385#issuecomment-208239163","issue_url":"https://api.github.com/repos/ant-design/ant-design/issues/1385","id":208239163,"user":{"login":"outrace","id":712424,"avatar_url":"https://avatars.githubusercontent.com/u/712424?v=3","gravatar_id":"","url":"https://api.github.com/users/outrace","html_url":"https://github.com/outrace","followers_url":"https://api.github.com/users/outrace/followers","following_url":"https://api.github.com/users/outrace/following{/other_user}","gists_url":"https://api.github.com/users/outrace/gists{/gist_id}","starred_url":"https://api.github.com/users/outrace/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/outrace/subscriptions","organizations_url":"https://api.github.com/users/outrace/orgs","repos_url":"https://api.github.com/users/outrace/repos","events_url":"https://api.github.com/users/outrace/events{/privacy}","received_events_url":"https://api.github.com/users/outrace/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T08:58:15Z","updated_at":"2016-04-11T08:58:15Z","body":"因为setFieldsValue的时候。如果DatePicker的value是Date类型。\r\n即使用户不操作。获取出来的也是Date类型。这样逻辑是通的。\r\n\r\n现在的情况是：设置value为String类型，用户不更改的话，得到String类型。更改的话，得到的就是Date类型。感觉很怪。"}}