发布时间:2024-01-01 08:00
<el-date-picker
size="medium"
v-model="export_from.time_range"
type="daterange"
value-format="timestamp"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="instantPickerOptions"
></el-date-picker>
export default {
data() {
return {
instantPickerOptions: {
//限制只能选一年范围
onPick: (obj) => {
this.pickerMinDate = new Date(obj.minDate).getTime();
console.log(obj)
},
disabledDate : time => {
if (this.pickerMinDate) {
const day1 = 366 * 24 * 3600 * 1000
let maxTime = this.pickerMinDate + day1
let minTime = this.pickerMinDate - day1
return time.getTime() > maxTime || time.getTime()<minTime
}
else{
//不能选今天之后的日期
return time.getTime() > Date.now()-1 * 24 * 3600 * 1000
}
}
//常用快捷
shortcuts: [
{
text: '今天',
onClick(picker) {
const now = new Date(new Date().toLocaleDateString());
const start = now.getTime();
picker.$emit('pick', [start, start]);
}
},
{
text: '昨天',
onClick(picker) {
const now = new Date(new Date().toLocaleDateString());
const start = now.getTime() - 60 * 60 * 24 * 1000;
picker.$emit('pick', [start, start]);
}
},
{
text: '本周',
onClick(picker) {
const now = new Date(new Date().toLocaleDateString());
const start = now.getTime() - (now.getDay() - 1) * 24 * 60 * 60 * 1000;
const end = start + 7 * 24 * 60 * 60 * 1000 - 1000;
picker.$emit('pick', [start, end]);
}
},
{
text: '上周',
onClick(picker) {
const now = new Date(new Date().toLocaleDateString());
const start = now.getTime() - (now.getDay() + 6) * 24 * 60 * 60 * 1000;
const end = start + 7 * 24 * 60 * 60 * 1000 - 1000;
picker.$emit('pick', [start, end]);
}
},
{
text: '本月',
onClick(picker) {
const now = new Date();
const startDate = new Date(now.getFullYear(), now.getMonth(), 1);
const endDate = new Date(now.getFullYear(), now.getMonth() + 1, 0);
picker.$emit('pick', [startDate.getTime(), endDate.getTime()]);
}
},
{
text: '上月',
onClick(picker) {
const now = new Date();
const startDate = new Date(now.getFullYear() - (now.getMonth() > 0 ? 0 : 1), (now.getMonth() + 11) % 12, 1);
const endDate = new Date(now.getFullYear(), now.getMonth(), 0);
picker.$emit('pick', [startDate.getTime(), endDate.getTime()]);
}
}
],
}
}
}
}
计算机毕业设计参考题目,含小程序,python,springboot和ssm
因程序员开发速度太慢,公司索赔 90 万败诉后不服申请再审,法院判了
yolov7从环境配置到训练自己的数据集AlexeyAB版本
【Spring+SpringMVC+Mybatis】Spring+SpringMVC+Mybatis实现前端到后台完整项目
子像素卷积keras_卷积神经网络实战(可视化部分)——使用keras识别猫咪_
接收后端返回的pdf文件流 前端使用Vue-pdf实现预览(分页)
spring security 验证用户登录以及获取当前登录的用户信息
[自用代码]基于python的遥感影像传统分割方法(直方图双峰法,阈值分割法,模糊C均值法,超像素分割法,K-means,snake)