Skip to content

Commit 46e9157

Browse files
committed
date-fnsをdayjsに置き換え
1 parent 971e744 commit 46e9157

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

src/components/__tests__/CalendarBar.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
Wrapper,
1111
} from '@vue/test-utils'
1212
// Components
13-
import formatISO from 'date-fns/formatISO'
13+
import dayjs from 'dayjs'
1414
import CalendarBar from '../CalendarBar.vue'
1515
// import View from '../CalendarBar.vue'
1616
// import StartWeekOn from '../CalendarBar.vue'
@@ -53,9 +53,9 @@ describe('CalendarBar.vue', () => {
5353
const dateListWindow = wrapper.vm.$data.dateListWindow
5454
expect(dateListWindow.view).toBe('Week')
5555
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+
)
5959
})
6060

6161
test('sets props correctly', () => {

src/pages/classes/index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
<script lang="ts">
2626
import Vue from 'vue'
27-
import isToday from 'date-fns/isToday'
2827
import { vxm } from '@/store'
2928
import PeriodSection from '@/components/PeriodSection.vue'
3029
@@ -50,7 +49,7 @@ export default Vue.extend({
5049
return vxm.app.currentDate
5150
},
5251
today() {
53-
return isToday(vxm.app.currentDate)
52+
return (this.$dayjs(vxm.app.currentDate) as any).isToday()
5453
},
5554
dateTitle() {
5655
return this.$dayjs(vxm.app.currentDate).format('M/D')

src/pages/edit/index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@
130130

131131
<script lang="ts">
132132
import Vue from 'vue'
133-
import isToday from 'date-fns/isToday'
134133
import { vxm } from '@/store'
135134
import PeriodSection from '@/components/PeriodSection.vue'
136135
import EditLessonScreenBottomSheet from '@/components/EditLessonScreenBottomSheet.vue'
@@ -211,7 +210,7 @@ export default Vue.extend({
211210
return vxm.app.currentDate
212211
},
213212
today() {
214-
return isToday(vxm.app.currentDate)
213+
return (this.$dayjs(vxm.app.currentDate) as any).isToday()
215214
},
216215
dateTitle() {
217216
return this.$dayjs(vxm.app.currentDate).format('M/D')

src/pages/lesson/index.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@
115115

116116
<script lang="ts">
117117
import Vue from 'vue'
118-
import 'dayjs/locale/ja'
119-
import add from 'date-fns/add'
120118
import { vxm } from '@/store'
121119
import SubjectTag from '@/components/SubjectTag.vue'
122120
import classData from '~/types/store/classData'
@@ -151,7 +149,7 @@ export default Vue.extend({
151149
return {
152150
id: '',
153151
startTime: new Date(),
154-
endTime: add(new Date(), { minutes: 40 }),
152+
endTime: this.$dayjs().add(40, 'minute'),
155153
title: '授業のタイトル',
156154
subject: {
157155
name: '教科名',

0 commit comments

Comments
 (0)