date、callendar
日期处理的方法以及实现日历组件的一些方法
Sophia George
路漫漫其修远兮,吾将上下而求索!撸代码之路任重而道远
展开
-
周日历组件处理数据展示
<template> <div> <div class="title"> <span class="buttons"> <el-button type="primary" plain @click="weekPrev">上一周</el-button> <el-button type="primary" plain @click="weekNext">下一周</el原创 2021-03-20 13:50:42 · 194 阅读 · 0 评论 -
天日历组件
两天一个维度,一天同理<template> <div> <div class="meeting-table"> <div class="table-day" :key="key" v-for="(meeting, key) in dayMeetingList" > <ul class="tableTitle today"> {{原创 2021-03-24 11:21:03 · 155 阅读 · 0 评论 -
elementUI日期组件禁用日期,只能选择同一天的日期
<el-date-picker v-if="item.type === 'date'" type="datetimerange" align="right" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" v-model="searchForm.date"原创 2021-03-23 11:26:09 · 1032 阅读 · 0 评论 -
IE浏览器选择日期兼容性问题
new Date() 时间兼容性问题,IE只识别 “2019/08/01 17:58:54” 斜杠格式,.getTime()才能正常转换成时间戳。‘-’这种的会返回NaN,其他浏览器‘/’或者‘-’都能正常运行。兼容记得转换原创 2021-01-27 16:22:41 · 615 阅读 · 0 评论 -
判断当前时间是否在指定时间段内
/** * [isDuringDate 比较当前时间是否在指定时间段内] * @author dongsir * @DateTime 2019-08-21 * @version 1.0 * @param date [beginDateStr] [开始时间] * @param date [endDateStr] [结束时间] * @return Boolean */var date = { isDuringDate: function (beginDat原创 2020-12-16 17:53:13 · 781 阅读 · 0 评论 -
无限获取当前周的上周,下周,以及当前周的日期
//获取当前周日期export const getWeekDay = (dateString) => { const dateStringReg = /^\d{4}[/-]\d{0,2}[/-]\d{0,2}$/ if (dateString.match(dateStringReg)) { const presentDate = new Date(dateString) const today = presentDate.getDay() !== 0 ? presentDa原创 2020-07-29 09:30:26 · 278 阅读 · 0 评论