@wmfs/json-to-vuelidate 1.22.2 → 1.22.3
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.
- package/CHANGELOG.md +7 -0
- package/lib/index.js +2 -2
- package/package.json +1 -1
- package/test/test.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.22.3](https://github.com/wmfs/json-to-vuelidate/compare/v1.22.2...v1.22.3) (2021-10-27)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### 🐛 Bug Fixes
|
|
5
|
+
|
|
6
|
+
* compare dates to be inclusive and precise to the day ([10fb6aa](https://github.com/wmfs/json-to-vuelidate/commit/10fb6aa3e512704d40915f6591a4000368bff49c))
|
|
7
|
+
|
|
1
8
|
## [1.22.2](https://github.com/wmfs/json-to-vuelidate/compare/v1.22.1...v1.22.2) (2021-10-27)
|
|
2
9
|
|
|
3
10
|
|
package/lib/index.js
CHANGED
|
@@ -116,7 +116,7 @@ function parse (val, key) {
|
|
|
116
116
|
return false
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
return mMin.isBefore(mValue)
|
|
119
|
+
return mMin.isBefore(mValue, 'day') || mMin.isSame(mValue, 'day')
|
|
120
120
|
}
|
|
121
121
|
break
|
|
122
122
|
}
|
|
@@ -131,7 +131,7 @@ function parse (val, key) {
|
|
|
131
131
|
return false
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
return mValue.isBefore(mMax)
|
|
134
|
+
return mValue.isBefore(mMax, 'day') || mValue.isSame(mMax, 'day')
|
|
135
135
|
}
|
|
136
136
|
break
|
|
137
137
|
}
|
package/package.json
CHANGED
package/test/test.js
CHANGED
|
@@ -87,14 +87,14 @@ describe('Test the vuelidate converter', function () {
|
|
|
87
87
|
const oneWeekAgoResult = fn(oneWeekAgo)
|
|
88
88
|
expect(oneWeekAgoResult).to.eql(false)
|
|
89
89
|
|
|
90
|
+
const threeDaysAgoResult = fn(threeDaysAgo)
|
|
91
|
+
expect(threeDaysAgoResult).to.eql(true)
|
|
92
|
+
|
|
90
93
|
const todayResult = fn(today)
|
|
91
94
|
expect(todayResult).to.eql(true)
|
|
92
95
|
|
|
93
96
|
const tomorrowResult = fn(tomorrow)
|
|
94
97
|
expect(tomorrowResult).to.eql(true)
|
|
95
|
-
|
|
96
|
-
const threeDaysAgoResult = fn(threeDaysAgo)
|
|
97
|
-
expect(threeDaysAgoResult).to.eql(true)
|
|
98
98
|
})
|
|
99
99
|
|
|
100
100
|
it('test the validation function for maximum date', () => {
|
|
@@ -108,7 +108,7 @@ describe('Test the vuelidate converter', function () {
|
|
|
108
108
|
expect(yesterdayResult).to.eql(true)
|
|
109
109
|
|
|
110
110
|
const todayResult = fn(today)
|
|
111
|
-
expect(todayResult).to.eql(
|
|
111
|
+
expect(todayResult).to.eql(true)
|
|
112
112
|
|
|
113
113
|
const tomorrowResult = fn(tomorrow)
|
|
114
114
|
expect(tomorrowResult).to.eql(false)
|