Skip to content

Commit 20b9752

Browse files
committed
0.28.1
1 parent 2ab364d commit 20b9752

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

dist/mobx-spine.cjs.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,11 +2054,11 @@ function checkMomentInstance(attr, value) {
20542054
}
20552055

20562056
function checkLuxonDateTime(attr, value) {
2057-
invariant(moment.isMoment(value), 'Attribute `' + attr + '` is not a luxon DateTime.');
2057+
invariant(luxon.DateTime.isDateTime(value), 'Attribute `' + attr + '` is not a luxon instance.');
20582058
}
20592059

20602060
var LUXON_DATE_FORMAT = 'yyyy-LL-dd';
2061-
var LUXON_DATETIME_FORMAT = 'yyy-LL-ddTHH:mm:ssZZZ';
2061+
var LUXON_DATETIME_FORMAT = "yyyy'-'LL'-'dd'T'HH':'mm':'ssZZ";
20622062

20632063
var CASTS = {
20642064
momentDate: {
@@ -2100,7 +2100,7 @@ var CASTS = {
21002100
if (value === null || value === undefined) {
21012101
return null;
21022102
}
2103-
return luxon.DateTime.fromFormat(value, LUXON_DATE_FORMAT);
2103+
return luxon.DateTime.fromISO(value);
21042104
},
21052105
toJS: function toJS(attr, value) {
21062106
if (value === null || value === undefined) {
@@ -2117,7 +2117,8 @@ var CASTS = {
21172117
if (value === null) {
21182118
return null;
21192119
}
2120-
return luxon.DateTime.fromFormat(value, LUXON_DATETIME_FORMAT);
2120+
2121+
return luxon.DateTime.fromISO(value);
21212122
},
21222123
toJS: function toJS(attr, value) {
21232124
if (value === null) {

dist/mobx-spine.es.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2048,11 +2048,11 @@ function checkMomentInstance(attr, value) {
20482048
}
20492049

20502050
function checkLuxonDateTime(attr, value) {
2051-
invariant(moment.isMoment(value), 'Attribute `' + attr + '` is not a luxon DateTime.');
2051+
invariant(DateTime.isDateTime(value), 'Attribute `' + attr + '` is not a luxon instance.');
20522052
}
20532053

20542054
var LUXON_DATE_FORMAT = 'yyyy-LL-dd';
2055-
var LUXON_DATETIME_FORMAT = 'yyy-LL-ddTHH:mm:ssZZZ';
2055+
var LUXON_DATETIME_FORMAT = "yyyy'-'LL'-'dd'T'HH':'mm':'ssZZ";
20562056

20572057
var CASTS = {
20582058
momentDate: {
@@ -2094,7 +2094,7 @@ var CASTS = {
20942094
if (value === null || value === undefined) {
20952095
return null;
20962096
}
2097-
return DateTime.fromFormat(value, LUXON_DATE_FORMAT);
2097+
return DateTime.fromISO(value);
20982098
},
20992099
toJS: function toJS$$1(attr, value) {
21002100
if (value === null || value === undefined) {
@@ -2111,7 +2111,8 @@ var CASTS = {
21112111
if (value === null) {
21122112
return null;
21132113
}
2114-
return DateTime.fromFormat(value, LUXON_DATETIME_FORMAT);
2114+
2115+
return DateTime.fromISO(value);
21152116
},
21162117
toJS: function toJS$$1(attr, value) {
21172118
if (value === null) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mobx-spine",
3-
"version": "0.28.0",
3+
"version": "0.28.1",
44
"license": "ISC",
55
"author": "Kees Kluskens <kees@webduck.nl>",
66
"description": "MobX with support for models, relations and an API.",

0 commit comments

Comments
 (0)