250x250
Notice
Recent Posts
Recent Comments
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
Tags
more
Archives
Today
Total
관리 메뉴

진스

vue에서 시간 타임 쉽게 표현 하기 본문

JavaScript

vue에서 시간 타임 쉽게 표현 하기

입방정 2022. 1. 6. 14:41
728x90
1번
console.log('tos',(new Date(Date.now() - (new Date()).getTimezoneOffset() * 60000)).toISOString().substr(0, 10));
console.log('tos2',new Date(new Date().getTime() - (new Date().getTimezoneOffset() * 60000)).toISOString().substr(0, 10));


vue에서 표현 하면 뷰티파이를 이용함.

 <v-date-picker
                :noTitle="true"
                locale="ko"
                :first-day-of-week="0"
                :show-current="false"
                v-model="date"
                :day-format="date => $moment(date).format('DD')" // 01,02,03 
                :day-format="date => new Date(date).getDate()" // 1, 2, 3 정수
                :day-format="date => $moment(date).format('dd')" // 'Sa','Su','Mo'
                min="2021-01-06"
                :max="$moment().format('YYYY-MM-DD')"
            ></v-date-picker>
 
 
  data () {
      return {
        picker: (new Date(Date.now() - (new Date()).getTimezoneOffset() * 60000)).toISOString().substr(0, 10) ,
        date : '',
      }
 
 created(){
      this.date = this.$moment().format('YYYY-MM-DD');
     },

2번

https://stackoverflow.com/questions/58568103/how-can-i-disable-all-sunday-on-datepicker

 

How can I disable all sunday on datepicker?

I use vuetify datepicker and moment js I want to disable sunday on datepicker My code like this : <v-date-picker v-model="date" :allowed-dates="allowedDates" class="mt...

stackoverflow.com

 

728x90
Comments