06 2018 档案

 
获取一个日期的年月日周
摘要:getYMD (date) { let year = date.getFullYear() let month = (date.getMonth() + 1 > 9) ? (date.getMonth() + 1 + '') : ('0' + (date.getMonth() + 1)) let d 阅读全文
posted @ 2018-06-13 09:49 momo-倩倩 阅读(166) 评论(0) 推荐(0)
获取一个日期月的所有日期
摘要:let daysOfMonth = []let fullYear = new Date(date).getFullYear()let month = new Date(date).getMonth() + 1month = month < 10 ? '0' + month : monthlet la 阅读全文
posted @ 2018-06-13 09:33 momo-倩倩 阅读(248) 评论(0) 推荐(0)
elementUI 日期 周一、周二、周三、周四、周五、周六、周日快捷键
摘要:<el-date-picker v-model="ruleForm.pickDateMeal" type="daterange" align="right" :range-separator="$t('message.To')" :start-placeholder="$t('message.Sta 阅读全文
posted @ 2018-06-12 11:02 momo-倩倩 阅读(5533) 评论(0) 推荐(0)
两个日期之间的天数集合
摘要:/** * 返回两个日期之间的天数集合 * @param start 开始日期 * @param end 结束日期 * @returns {Array} */ export const twoDateDays = function (start, end) { let arr = [] let st 阅读全文
posted @ 2018-06-12 11:00 momo-倩倩 阅读(216) 评论(0) 推荐(0)
数组去重并排序
摘要:unique (arr) { for (let i = 0; i < arr.length; i++) { for (let j = i + 1; j < arr.length; j++) { if (arr[i] arr[j]) { arr.splice(j, 1) j-- } } } // 升序 阅读全文
posted @ 2018-06-04 14:29 momo-倩倩 阅读(209) 评论(0) 推荐(0)
日历封装
摘要:getManthDate (year, month) { this.year = parseInt(year) this.month = parseInt(month) if (month === 13) { month = 1 this.month = 1 year += 1 this.year 阅读全文
posted @ 2018-06-04 10:31 momo-倩倩 阅读(154) 评论(0) 推荐(0)