WIP Сделала отсчет времени
This commit is contained in:
@@ -3,25 +3,26 @@
|
||||
span.text-base(
|
||||
v-for="hour in timeCoil",
|
||||
:key="hour",
|
||||
:class="currentHourStyle(hour)"
|
||||
) {{ hour }}
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { convertTime } from "@/pages/newCalendar/utils/calendarFunctions.js";
|
||||
export default {
|
||||
name: "CalendarClockColumn",
|
||||
props: {
|
||||
timeCoil: Array,
|
||||
currentTime: String,
|
||||
currentDate: Object,
|
||||
dayEndTime: Number,
|
||||
isCurrentDate: Boolean,
|
||||
isCurrentWeek: Boolean,
|
||||
},
|
||||
computed: {
|
||||
currentHour() {
|
||||
return this.convertTime(this.currentTime, 0, -6);
|
||||
return convertTime(this.currentTime, 0, -6);
|
||||
},
|
||||
currentMinute() {
|
||||
return this.convertTime(this.currentTime, 3, -3);
|
||||
return convertTime(this.currentTime, 3, -3);
|
||||
},
|
||||
isEndDay() {
|
||||
return this.dayEndTime === this.currentHour && this.currentMinute > 0;
|
||||
@@ -30,9 +31,9 @@ export default {
|
||||
methods: {
|
||||
currentHourStyle(elem) {
|
||||
if (
|
||||
this.convertTime(elem, 0, 3) === this.currentHour &&
|
||||
convertTime(elem, 0, 3) === this.currentHour &&
|
||||
!this.isEndDay &&
|
||||
this.isCurrentDate
|
||||
this.isCurrentWeek
|
||||
) {
|
||||
return {
|
||||
"current-time": true,
|
||||
@@ -44,9 +45,6 @@ export default {
|
||||
"font-medium": true,
|
||||
};
|
||||
},
|
||||
convertTime(str, startIndex, endIndex) {
|
||||
return parseInt(str?.slice(startIndex, endIndex), 10);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user