Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataPicker样式问题 #3312

Closed
wuzeru opened this issue Oct 7, 2016 · 2 comments
Closed

DataPicker样式问题 #3312

wuzeru opened this issue Oct 7, 2016 · 2 comments

Comments

@wuzeru
Copy link

wuzeru commented Oct 7, 2016

发生问题的环境是:

  • antd 版本: 2.0.1
  • 操作系统及其版本: OSX EI Caption 10.11
  • 浏览器及其版本: chrome 53.0.2785.143

您做了什么?

import {Form,Input,DatePicker,Switch} from 'antd';
import moment from 'moment-timezone/moment-timezone';

// 推荐在入口文件全局设置 locale 与时区
import 'moment/locale/zh-cn';
moment.locale('zh-cn');
// 从 https://github.com/moment/moment-timezone/blob/develop/data/packed/latest.json 复制
moment.tz.add('Asia/Shanghai|CST CDT|-80 -90|01010101010101010|-1c1I0 LX0 16p0 1jz0 1Myp0 Rb0 1o10 11z0 1o10 11z0 1qN0 11z0 1o10 11z0 1o10 11z0|23e6');
moment.tz.setDefault('Asia/Shanghai')

const disabledDate = function (current) {
                return current && current.valueOf() < Date.now() - 86400000;
            };

            var onChange = (data,dataString) => {
                console.log(data,dataString);
                // fieldProps.get('onChange')(data);
            }

            var format = "YYYY-MM-DD HH:mm:ss";

            var value = fieldProps.get('value') ? moment(new Date(fieldProps.get('value'))) : '';

            return (
                <DatePicker
                    showTime
                    format ={format}
                    placeholder={fieldProps.get('placeholder') }
                    onChange={onChange}/>
            );

您期待的结果是:像官网一样正常显示

实际上的结果是:

TimePicker 没有样式
qq20161007-0

其他

DatePicker是要强制使用moment.js吗?

@afc163 afc163 closed this as completed in f1d0223 Oct 7, 2016
@afc163
Copy link
Member

afc163 commented Oct 7, 2016

also close #3307

@lock
Copy link

lock bot commented May 4, 2018

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators May 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants