From 3aac9adc406ee1924b913eeb205370e9c2488e19 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Fri, 24 Feb 2017 16:17:52 +0800 Subject: [PATCH] docs: remove some demo --- .../__tests__/__snapshots__/demo.test.js.snap | 784 ------------------ components/calendar/demo/locale.md | 35 - .../__tests__/__snapshots__/demo.test.js.snap | 18 - components/date-picker/__tests__/demo.test.js | 11 - components/date-picker/demo/locale.md | 46 - 5 files changed, 894 deletions(-) delete mode 100644 components/calendar/demo/locale.md delete mode 100644 components/date-picker/demo/locale.md diff --git a/components/calendar/__tests__/__snapshots__/demo.test.js.snap b/components/calendar/__tests__/__snapshots__/demo.test.js.snap index 5593434260..5187e3d717 100644 --- a/components/calendar/__tests__/__snapshots__/demo.test.js.snap +++ b/components/calendar/__tests__/__snapshots__/demo.test.js.snap @@ -1569,790 +1569,6 @@ exports[`test renders ./components/calendar/demo/card.md correctly 1`] = ` `; -exports[`test renders ./components/calendar/demo/locale.md correctly 1`] = ` -
-
-
- -
-
- -
-
- - -
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - Su - - - - Mo - - - - Tu - - - - We - - - - Th - - - - Fr - - - - Sa - -
-
-
- 30 -
-
-
-
-
-
- 31 -
-
-
-
-
-
- 01 -
-
-
-
-
-
- 02 -
-
-
-
-
-
- 03 -
-
-
-
-
-
- 04 -
-
-
-
-
-
- 05 -
-
-
-
-
-
- 06 -
-
-
-
-
-
- 07 -
-
-
-
-
-
- 08 -
-
-
-
-
-
- 09 -
-
-
-
-
-
- 10 -
-
-
-
-
-
- 11 -
-
-
-
-
-
- 12 -
-
-
-
-
-
- 13 -
-
-
-
-
-
- 14 -
-
-
-
-
-
- 15 -
-
-
-
-
-
- 16 -
-
-
-
-
-
- 17 -
-
-
-
-
-
- 18 -
-
-
-
-
-
- 19 -
-
-
-
-
-
- 20 -
-
-
-
-
-
- 21 -
-
-
-
-
-
- 22 -
-
-
-
-
-
- 23 -
-
-
-
-
-
- 24 -
-
-
-
-
-
- 25 -
-
-
-
-
-
- 26 -
-
-
-
-
-
- 27 -
-
-
-
-
-
- 28 -
-
-
-
-
-
- 29 -
-
-
-
-
-
- 30 -
-
-
-
-
-
- 01 -
-
-
-
-
-
- 02 -
-
-
-
-
-
- 03 -
-
-
-
-
-
- 04 -
-
-
-
-
-
- 05 -
-
-
-
-
-
- 06 -
-
-
-
-
-
- 07 -
-
-
-
-
-
- 08 -
-
-
-
-
-
- 09 -
-
-
-
-
-
- 10 -
-
-
-
-
-
-
-`; - exports[`test renders ./components/calendar/demo/notice-calendar.md correctly 1`] = `
diff --git a/components/calendar/demo/locale.md b/components/calendar/demo/locale.md deleted file mode 100644 index 9883046c63..0000000000 --- a/components/calendar/demo/locale.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -order: 3 -title: - zh-CN: 国际化 - en-US: Localization ---- - -## zh-CN - -通过 `LocaleProvider` 配置语言。 - -## en-US - -To set the language. - -````jsx -import { Calendar, LocaleProvider } from 'antd'; -import enUS from 'antd/lib/locale-provider/en_US'; -import moment from 'moment'; -// It's recommended to set moment locale globally, otherwise, you need to set it by `value` or `defaultValue` -// moment.locale('en'); - -function onPanelChange(value, mode) { - console.log(value, mode); -} -ReactDOM.render( - - - , - mountNode -); -```` diff --git a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap index ac220ecebc..0756b26a28 100644 --- a/components/date-picker/__tests__/__snapshots__/demo.test.js.snap +++ b/components/date-picker/__tests__/__snapshots__/demo.test.js.snap @@ -210,24 +210,6 @@ exports[`test renders ./components/date-picker/demo/format.md correctly 1`] = `
`; -exports[`test renders ./components/date-picker/demo/locale.md correctly 1`] = ` - - - - - - - -`; - exports[`test renders ./components/date-picker/demo/presetted-ranges.md correctly 1`] = `
{ - MockDate.set(new Date('2016-11-22').getTime()); - const LocaleDemo = require('../demo/locale'); // eslint-disable-line global-require - const wrapper = render(LocaleDemo); - expect(renderToJson(wrapper)).toMatchSnapshot(); - MockDate.reset(); -}); diff --git a/components/date-picker/demo/locale.md b/components/date-picker/demo/locale.md deleted file mode 100644 index 35564e88c8..0000000000 --- a/components/date-picker/demo/locale.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -order: 7 -title: - zh-CN: 国际化 - en-US: Localization ---- - -## zh-CN - -通过 `LocaleProvider` 设置语言。 - -`moment` 会自动使用当前时区,如果需要使用别的时区,则需要自行设置,设置方法请参考示例代码中的注释。 - -## en-US - -Use locale to set the language. - -`moment` will use your time zone automatically. If you want to set other time zone, please set it by yourself. - - -````jsx -import { DatePicker, LocaleProvider } from 'antd'; -import enUS from 'antd/lib/locale-provider/en_US'; -import moment from 'moment-timezone/moment-timezone'; - -// It's recommended to set moment locale and time zone globally in entry file, -// otherwise, you need to set it by `value` or `defaultValue`. -// moment.locale('en'); - -// The following data is copied from https://github.com/moment/moment-timezone/blob/develop/data/packed/latest.json -// moment.tz.add('Europe/London|GMT BST BDST|0 -10 -20|0101010101010101010101010101010101010101010101010121212121210101210101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010|-2axa0 Rc0 1fA0 14M0 1fc0 1g00 1co0 1dc0 1co0 1oo0 1400 1dc0 19A0 1io0 1io0 WM0 1o00 14o0 1o00 17c0 1io0 17c0 1fA0 1a00 1lc0 17c0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1cM0 1io0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1io0 1qM0 Dc0 2Rz0 Dc0 1zc0 Oo0 1zc0 Rc0 1wo0 17c0 1iM0 FA0 xB0 1fA0 1a00 14o0 bb0 LA0 xB0 Rc0 1wo0 11A0 1o00 17c0 1fA0 1a00 1fA0 1cM0 1fA0 1a00 17c0 1fA0 1a00 1io0 17c0 1lc0 17c0 1fA0 1a00 1io0 17c0 1io0 17c0 1fA0 1a00 1a00 1qM0 WM0 1qM0 11A0 1o00 WM0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1tA0 IM0 90o0 U00 1tA0 U00 1tA0 U00 1tA0 U00 1tA0 WM0 1qM0 WM0 1qM0 WM0 1tA0 U00 1tA0 U00 1tA0 11z0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1o00 14o0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00 11A0 1qM0 WM0 1qM0 WM0 1qM0 WM0 1qM0 11A0 1o00 11A0 1o00|10e6'); -// moment.tz.setDefault('Europe/London') - -const log = console.log.bind(console); - -ReactDOM.render( - - - , - mountNode -); -````