Skip to content

When webpack is not used, DatePicker and Calendar dates are not displayed correctly #6712

@priornix

Description

@priornix

Version

2.11.2

Environment

OS Version: OS X (10.11.6), Windows 7 (64bit); Browsers: Firefox 54.0.1, Chrome Version 58.0.3018.0 canary (64-bit)

Reproduction link

https://codepen.io/priornix/pen/PjeEZv?editors=0010

Steps to reproduce

  • Import antd library (antd.js or antd.min.js) directly into the browser
  • Set moment localization using moment.locale()
  • Setup locale provider with 1 DatePicker without any defaultValue, 1 DatePicker with defaultValue, 1 Calendar without defaultValue

For DatePicker without any defaultValue:

  • Click on DatePicker (Russian dates are displayed)
  • Select a date
  • Click on DatePicker (calendar date is still wrong)

For DatePicker with defaultValue set:

  • Click on DatePicker (date is correctly displayed)
  • Clear the date on DatePicker
  • Click on DatePicker (Russian dates are displayed)

For Calendar without defaultValue set:

  • Dates are not displayed correctly

What is expected?

  • DatePicker's calendar dates should be correct when no date values has been set
  • Calendar's dates should be correct when no date values has been set

What is actually happening?

  • Dates are not displayed correctly (ie: they will be shown in Russian text) in DatePicker's calendar or Calendar when:
    • DatePicker or Calendar defaultValue is not set
    • When date value is cleared from DatePicker

This issue is related to #4972 and #6645

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions