File tree Expand file tree Collapse file tree 4 files changed +7
-11
lines changed Expand file tree Collapse file tree 4 files changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import {
10
10
Wrapper ,
11
11
} from '@vue/test-utils'
12
12
// Components
13
- import formatISO from 'date-fns/formatISO '
13
+ import dayjs from 'dayjs '
14
14
import CalendarBar from '../CalendarBar.vue'
15
15
// import View from '../CalendarBar.vue'
16
16
// import StartWeekOn from '../CalendarBar.vue'
@@ -53,9 +53,9 @@ describe('CalendarBar.vue', () => {
53
53
const dateListWindow = wrapper . vm . $data . dateListWindow
54
54
expect ( dateListWindow . view ) . toBe ( 'Week' )
55
55
expect ( dateListWindow . startWeekOn ) . toBe ( 'Monday' )
56
- expect (
57
- formatISO ( dateListWindow . currentDate , { representation : 'date' } )
58
- ) . toBe ( formatISO ( new Date ( ) , { representation : 'date' } ) )
56
+ expect ( dayjs ( dateListWindow . currentDate ) . toISOString ( ) ) . toBe (
57
+ dayjs ( ) . toISOString ( )
58
+ )
59
59
} )
60
60
61
61
test ( 'sets props correctly' , ( ) => {
Original file line number Diff line number Diff line change 24
24
25
25
<script lang="ts">
26
26
import Vue from ' vue'
27
- import isToday from ' date-fns/isToday'
28
27
import { vxm } from ' @/store'
29
28
import PeriodSection from ' @/components/PeriodSection.vue'
30
29
@@ -50,7 +49,7 @@ export default Vue.extend({
50
49
return vxm .app .currentDate
51
50
},
52
51
today() {
53
- return isToday ( vxm .app .currentDate )
52
+ return ( this . $dayjs ( vxm .app .currentDate ) as any ). isToday ( )
54
53
},
55
54
dateTitle() {
56
55
return this .$dayjs (vxm .app .currentDate ).format (' M/D' )
Original file line number Diff line number Diff line change 130
130
131
131
<script lang="ts">
132
132
import Vue from ' vue'
133
- import isToday from ' date-fns/isToday'
134
133
import { vxm } from ' @/store'
135
134
import PeriodSection from ' @/components/PeriodSection.vue'
136
135
import EditLessonScreenBottomSheet from ' @/components/EditLessonScreenBottomSheet.vue'
@@ -211,7 +210,7 @@ export default Vue.extend({
211
210
return vxm .app .currentDate
212
211
},
213
212
today() {
214
- return isToday ( vxm .app .currentDate )
213
+ return ( this . $dayjs ( vxm .app .currentDate ) as any ). isToday ( )
215
214
},
216
215
dateTitle() {
217
216
return this .$dayjs (vxm .app .currentDate ).format (' M/D' )
Original file line number Diff line number Diff line change 115
115
116
116
<script lang="ts">
117
117
import Vue from ' vue'
118
- import ' dayjs/locale/ja'
119
- import add from ' date-fns/add'
120
118
import { vxm } from ' @/store'
121
119
import SubjectTag from ' @/components/SubjectTag.vue'
122
120
import classData from ' ~/types/store/classData'
@@ -151,7 +149,7 @@ export default Vue.extend({
151
149
return {
152
150
id: ' ' ,
153
151
startTime: new Date (),
154
- endTime: add ( new Date (), { minutes: 40 } ),
152
+ endTime: this . $dayjs (). add ( 40 , ' minute ' ),
155
153
title: ' 授業のタイトル' ,
156
154
subject: {
157
155
name: ' 教科名' ,
You can’t perform that action at this time.
0 commit comments