日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 前端技术 > vue >内容正文

vue

vue 得到当月的天数getDate()方法

發(fā)布時(shí)間:2023/12/29 vue 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vue 得到当月的天数getDate()方法 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

vue 得到當(dāng)月的天數(shù)getDate()方法

getDate()
today.getMonth() + 1,加 1 得到當(dāng)前月份
new Date(today.getFullYear(), today.getMonth(), 0);
得到當(dāng)前的年份,月份,0代表 today.getMonth()月1號(hào)的前一天。
date = new Date(2017,11,0);//表示date是2017/12/1號(hào)的前一天,就是2017/11/30這天
通常用new Date(2020,2,0).getDate()計(jì)算某月的天數(shù)

var today = new Date(); // 獲取當(dāng)月天數(shù) curretMonthDayCountvar curretMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);var curretMonthDayCount = curretMonth.getDate(); // 獲取上個(gè)月天數(shù) preMonthDayCountvar preMonth = new Date(today.getFullYear(), today.getMonth(), 0);var preMonthDayCount = preMonth.getDate(); // 獲取前一個(gè)月天數(shù)var beforePreMonth = new Date(today.getFullYear(), today.getMonth() - 1, 0);var beforePreMonthDayCount = beforePreMonth.getDate();

總結(jié)

以上是生活随笔為你收集整理的vue 得到当月的天数getDate()方法的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。