WIP Сделала CalendarHeader, подключила moment js
This commit is contained in:
@@ -1,10 +1,29 @@
|
||||
<template lang="pug">
|
||||
calendar-header
|
||||
calendar-header(
|
||||
:currentDay="currentDate"
|
||||
@previous-date="switchPreviousDate"
|
||||
@next-date="switchNextDate")
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as moment from "moment/moment";
|
||||
import CalendarHeader from "./components/CalendarHeader.vue";
|
||||
moment.locale("ru");
|
||||
export default {
|
||||
name: "TheCalendar",
|
||||
components: { CalendarHeader },
|
||||
data() {
|
||||
return {
|
||||
currentDate: moment(),
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
switchPreviousDate() {
|
||||
this.currentDate = this.currentDate.clone().subtract(1, "day");
|
||||
},
|
||||
switchNextDate() {
|
||||
this.currentDate = this.currentDate.clone().add(1, "day");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user