react-picky-date-time 1.9.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ {
2
+ "files": [
3
+ "README.md"
4
+ ],
5
+ "imageSize": 100,
6
+ "commit": false,
7
+ "contributors": [
8
+ {
9
+ "login": "edwardfxiao",
10
+ "name": "Edward Xiao",
11
+ "avatar_url": "https://avatars.githubusercontent.com/u/11728228?v=4",
12
+ "profile": "https://github.com/edwardfxiao",
13
+ "contributions": [
14
+ "code",
15
+ "doc",
16
+ "infra",
17
+ "test",
18
+ "review"
19
+ ]
20
+ }
21
+ ],
22
+ "contributorsPerLine": 7,
23
+ "projectName": "react-picky-date-time",
24
+ "projectOwner": "edwardfxiao",
25
+ "repoType": "github",
26
+ "repoHost": "https://github.com",
27
+ "skipCi": true
28
+ }
package/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # 2.0.2
2
+
3
+ - Support IE9+
4
+
5
+ # 2.0.1
6
+
7
+ - Fix markedDates not showing correctly bug
8
+
9
+ # 2.0.0
10
+
11
+ - Rewite with React Hooks
12
+ - Support TS
13
+ - Using https://gist.github.com/jakearchibald/cb03f15670817001b1157e62a076fe95 method to do the timer
14
+ - Not supporting IE anymore
package/README.md CHANGED
@@ -1,4 +1,7 @@
1
1
  # react-picky-date-time
2
+ <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3
+ [![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
4
+ <!-- ALL-CONTRIBUTORS-BADGE:END -->
2
5
  [![npm version](https://badge.fury.io/js/react-picky-date-time.svg)](https://badge.fury.io/js/react-picky-date-time) ![npm bundle size (minified + gzip)](https://img.shields.io/bundlephobia/minzip/react-picky-date-time.svg) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/edwardfxiao/react-picky-date-time/master/LICENSE)[![LICENSE](https://img.shields.io/badge/license-Anti%20996-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)
3
6
 
4
7
  A react component for date time picker.
@@ -18,12 +21,20 @@ Attention: <a href="https://github.com/edwardfxiao/react-picky-date-time/blob/gh
18
21
  * <a href="https://codesandbox.io/s/y29w6p6krj">Online demo example playground</a>
19
22
  * <a href="https://codesandbox.io/s/l3n2ypvrzl">Custom locales</a>(when providing ```window.REACT_PICKY_DATE_TIME['customLocale']```)
20
23
 
24
+ ### :tada: For version >= 2.0.0, please update react and react-dom to at least ```16.8.6```, since it is rewrited with hooks.
25
+ ```js
26
+ "peerDependencies": {
27
+ "react": ">= 16.8.6",
28
+ "react-dom": ">= 16.8.6"
29
+ }
30
+ ```
31
+
21
32
  # Docs Link
22
33
  [Custom Locale Guid(can be multiple locales)](#custom-locale)
23
34
 
24
35
  # Usage
25
36
  ```js
26
- import PickyDateTime from 'react-picky-date-time';
37
+ import ReactPickyDateTime from 'react-picky-date-time';
27
38
 
28
39
  ...
29
40
  class YourOwnComponent extends Component {
@@ -54,7 +65,7 @@ class YourOwnComponent extends Component {
54
65
  } = this.state;
55
66
 
56
67
  return(
57
- <PickyDateTime
68
+ <ReactPickyDateTime
58
69
  size="m"// 'xs', 's', 'm', 'l'
59
70
  mode={0} //0: calendar only, 1: calendar and clock, 2: clock only; default is 0
60
71
  locale={`zh-cn`}// 'en-us' or 'zh-cn'; default is en-us
@@ -93,6 +104,15 @@ npm install react-picky-date-time --save
93
104
  # Browser support
94
105
  Tested on IE9+ and Chrome and Safari(10.0.3)
95
106
 
107
+ This library relies ```new AbortController```, so if you are developing for IE10+ you should include the polyfill like below
108
+ ```js
109
+ import 'promise-polyfill/src/polyfill';
110
+ import 'unfetch/polyfill';
111
+ import 'abortcontroller-polyfill';
112
+ ```
113
+
114
+ For IE9, you also need ```performance``` ```requestAnimationFrame``` polyfill for clock ticking
115
+
96
116
  # Events
97
117
 
98
118
  Also consoled out on the demo page examples
@@ -198,3 +218,23 @@ By providing ```window.REACT_PICKY_DATE_TIME['customLocale']```, you can overwri
198
218
  }
199
219
  </script>
200
220
  ```
221
+
222
+ ## Contributors ✨
223
+
224
+ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
225
+
226
+ <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
227
+ <!-- prettier-ignore-start -->
228
+ <!-- markdownlint-disable -->
229
+ <table>
230
+ <tr>
231
+ <td align="center"><a href="https://github.com/edwardfxiao"><img src="https://avatars.githubusercontent.com/u/11728228?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Edward Xiao</b></sub></a><br /><a href="https://github.com/edwardfxiao/react-picky-date-time/commits?author=edwardfxiao" title="Code">💻</a> <a href="https://github.com/edwardfxiao/react-picky-date-time/commits?author=edwardfxiao" title="Documentation">📖</a> <a href="#infra-edwardfxiao" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="https://github.com/edwardfxiao/react-picky-date-time/commits?author=edwardfxiao" title="Tests">⚠️</a> <a href="https://github.com/edwardfxiao/react-picky-date-time/pulls?q=is%3Apr+reviewed-by%3Aedwardfxiao" title="Reviewed Pull Requests">👀</a></td>
232
+ </tr>
233
+ </table>
234
+
235
+ <!-- markdownlint-restore -->
236
+ <!-- prettier-ignore-end -->
237
+
238
+ <!-- ALL-CONTRIBUTORS-LIST:END -->
239
+
240
+ This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface CalendarProps {
3
+ size: string;
4
+ locale: string;
5
+ defaultDate: string;
6
+ markedDates: Array<string>;
7
+ supportDateRange: Array<string>;
8
+ onYearPicked?: (res: object) => void;
9
+ onMonthPicked?: (res: object) => void;
10
+ onDatePicked?: (res: object) => void;
11
+ onResetDate?: (res: object) => void;
12
+ onResetDefaultDate?: (res: object) => void;
13
+ }
14
+ declare const Calendar: React.FC<CalendarProps>;
15
+ export default Calendar;
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ interface ClockProps {
3
+ size: string;
4
+ locale: string;
5
+ defaultTime: string;
6
+ onSecondChange?: (res: object) => void;
7
+ onMinuteChange?: (res: object) => void;
8
+ onHourChange?: (res: object) => void;
9
+ onMeridiemChange?: (res: string) => void;
10
+ onResetTime?: (res: object) => void;
11
+ onClearTime?: (res: object) => void;
12
+ onResetDefaultTime?: (res: object) => void;
13
+ }
14
+ declare const Clock: React.FC<ClockProps>;
15
+ export default Clock;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import '../../css/index.css';
3
+ interface IndexProps {
4
+ mode: number;
5
+ size: string;
6
+ locale: string;
7
+ markedDates?: Array<string>;
8
+ supportDateRange?: Array<string>;
9
+ defaultDate?: string;
10
+ defaultTime?: string;
11
+ show?: boolean;
12
+ onClose?: () => void;
13
+ onYearPicked?: (res: object) => void;
14
+ onMonthPicked?: (res: object) => void;
15
+ onDatePicked?: (res: object) => void;
16
+ onResetDate?: (res: object) => void;
17
+ onSecondChange?: (res: object) => void;
18
+ onMinuteChange?: (res: object) => void;
19
+ onHourChange?: (res: object) => void;
20
+ onMeridiemChange?: (res: string) => void;
21
+ onResetTime?: (res: object) => void;
22
+ onClearTime?: (res: object) => void;
23
+ onResetDefaultDate?: (res: object) => void;
24
+ onResetDefaultTime?: (res: object) => void;
25
+ }
26
+ declare const Index: React.FC<IndexProps>;
27
+ export default Index;