You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
4.0.0-beta.0: Updated date parsing and imports (#72)
* 4.0.0-beta.0: Updated date parsing and imports. See changelog for full details
* Fix build out of date
* Format files prettier
* Fixed prettier and README
* Fix function definitions
* Fix rollup transform
* Move to typescript and revert name change
* Fix types
* Change to alpha
* Fixes for named imports
Copy file name to clipboardExpand all lines: CHANGELOG.md
+36Lines changed: 36 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,39 @@
1
+
## 4.0.0-alpha.0
2
+
** Major Features and Breaking changes in this version**
3
+
4
+
#### Improvements
5
+
-*Valid date parsing* - By default fecha will check validity of dates. Previously `2019-55-01` or `2019-01-42` would parse correctly, since Javascript can handle it. Now invalid dates will return `null` instead
6
+
-*ES Module and Tree Shaking Support* - You can now import fecha `parse` or `format` independently
7
+
```js
8
+
import {format, parse} from'fecha';
9
+
10
+
format(...);
11
+
parse(...)
12
+
13
+
14
+
#### Breaking changes
15
+
-`parseDate` may return`null` when previously returned a `Date`. See improvements above, but invalid dates will return`null` now
16
+
- Change to how to set masks and i18n
17
+
Previously
18
+
```js
19
+
import fecha from 'fecha';
20
+
21
+
fecha.i18n = { ... }
22
+
fecha.masks.myMask = 'DD , MM, YYYY'
23
+
```
24
+
25
+
New
26
+
```js
27
+
import {parse, format, setGlobalDateI18n, setGlobalDateMasks} from 'fecha';
28
+
29
+
setGlobalDateI18n({
30
+
// ...
31
+
})
32
+
setGlobalDateMasks({
33
+
myMask: 'DD , MM, YYYY'
34
+
});
35
+
```
36
+
1
37
### 3.0.3
2
38
- Fixed bug when using brackets when parsing dates
0 commit comments