Skip to content

Commit 02b6f39

Browse files
committed
specify month value in 0-11 range
1 parent 08cd98c commit 02b6f39

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/examples/src/flight-booker/App/composition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export default {
2424

2525
function stringToDate(str) {
2626
const [y, m, d] = str.split('-')
27-
return new Date(+y, +m, +d)
27+
return new Date(+y, m - 1, +d)
2828
}
2929

3030
function dateToString(date) {

src/examples/src/flight-booker/App/options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function stringToDate(str) {
22
const [y, m, d] = str.split('-')
3-
return new Date(+y, +m, +d)
3+
return new Date(+y, m - 1, +d)
44
}
55

66
function dateToString(date) {

0 commit comments

Comments
 (0)