以下为一个简单日历展示的使用方法
{
"usingComponents": {
"calendar": "/your_component_path/calendar/index"
}
}
在页面 wxml
中引入组件
<calendar />
更多自定义配置及功能 请查阅日历文档
微信小程序-日历组件 📅
License: MIT License
以下为一个简单日历展示的使用方法
{
"usingComponents": {
"calendar": "/your_component_path/calendar/index"
}
}
在页面 wxml
中引入组件
<calendar />
更多自定义配置及功能 请查阅日历文档
就是类似于农历的显示,想自定义节日
现有个需求,根据日历选择时间,后端返回事件标记的日期然后重新渲染日历,但是日历重新渲染又跳转到今天了,这是为什么???急!急!急!
大神你好, 我现在用您开发的日历控件,非常好用,首先给您赞一个,
现在用户提了一个反馈,说那个左滑,或者右滑动的时候,没有动画效果,感觉非常生硬,
能抽空把这个实现不,谢谢啦!!
像MIUI自带日历的那种,默认展示月历视图,通过监听滑动,切换到周历视图,节省屏幕空间
`
Page({
onShow: function() {
const conf = {
/multi: true, // 是否开启多选,/
afterTapDay: (currentSelect) => {
console.log(currentSelect) // return {}
},
}
initCalendar(conf); // 使用默认配置初始化日历
}
});`
RT.. so sad
deleteTodoLabels这个方法在模块中没有啊。请问我下载的没有呢
空了把这个扩展下
切换周视图,2月有31日。
另外,是否可以初始化后一直保持周模式。
iOS端 全白 没有任何显示
请问怎么禁选部分日期的
这个不难解决,总之是非常好的控件,打算用在自己的程序里。
谢谢~
点击日期,没有选中效果。
做成template 是不是更实用呢
第一个问题是,事件标记只能设置在当前月嘛?我试了设置其他月份的事件标记,都是没有显示出来的;
第二个问题是,setTodoLabels方法为什么不能在非initCalendar的地方调用呢?如果不能的话,要怎么实现动态更新有事件标记的日期呢?
最后表达一下对作者的感谢之情~帮了我挺大忙的
setTodoLabels({
pos: 'bottom',
dotColor: '#40',
days: [{
year: 2018,
month: 9,
day: 12,
}, {
year: 2018,
month: 9,
day: 15,
}, {
year: 2018,
month: 8,
day: 5,
}],
});
当初始化时显示9月,9/12和9/15事项加载正确,但是切换到8月时,显示还是12号和15号事项
1.、未提供获取日期的函数
2、 未提供可重写的点击事件函数
比如选中 日历中某一天 返回当前时间字段 ,这样的话这个日历就只是做展示使用了
enableArea选定范围之后月日历没问题,但在周日历的情况下左滑右滑切换时间之后选定的范围就没有效果了
不加onTapDay事件,选择一个日期后会有背景色选中效果,添加之后没有了。。。
如何保持选中效果
还有如何更改选中背景色
rt,谢谢
在taro中以模板形式引入,日历内容不能显示
没有任何报错,代码如下:
import Taro, { Component } from '@tarojs/taro'
import { View } from '@tarojs/components'
import Calendar from './calendar/index'
import './calendar/index.wxss'
/**
* 需要注意的是,在项目的 config/index.js 文件中,有 copy 模板与样式的操作
*/
const conf = {
disablePastDay: true, // 是否禁选过去的日期
/**
* 选择日期后执行的事件
* @param { object } currentSelect 当前点击的日期
* @param { array } allSelectedDays 选择的所有日期(当mulit为true时,才有allSelectedDays参数)
*/
afterTapDay: (currentSelect, allSelectedDays) => {},
/**
* 日期点击事件(此事件会完全接管点击事件)
* @param { object } currentSelect 当前点击的日期
* @param { object } event 日期点击事件对象
*/
onTapDay(currentSelect, event) {},
/**
* 日历初次渲染完成后触发事件,如设置事件标记
*/
afterCalendarRender() {},
}
export default class calendarComponent extends Component {
componentDidMount () {
Calendar(conf);
}
render () {
return (
<View>
<import src='./calendar/index.wxml' />
<view class="calendar-wrap">
<template is="calendar" data="{{...calendar}}" />
</view>
</View>
)
}
}
1 禁止选日期时间不起作用,麻烦看看什么原因,本地小程序软件调试可以,真机上没有效果
跳转的方法,可以触发,但是无法实现跳转的功能
增加翻动监听事件后,跟日期绑定的查询可以分页。否则要全集查询
想在多选状态下把getSelectedDay()得到的数据赋给days,但setTodoLabels设置无效
RT
当月是2018年9月11日
setTodoLabels({
pos: 'bottom',
dotColor: '#40',
days: [{
year:2018,
month:10,
day:2
}]
});
设置10月的待办,然后切换到10月,日历上不显示
但是如果同时标记了当前月和10月就可以显示
setTodoLabels({
pos: 'bottom',
dotColor: '#40',
days: [{
year:2018,
month:10,
day:2
},{
year:2018,
month:9,
day:10
}]
});
enableArea选定(2018-09-01至2019-01-31)有效日期会多三天,到2019-02-03,应该是没计算10,11,01月31号,
可否设置可选区域数组不为区间,而是一个固定数值的数组,通过遍历设置为可选为哪几项?
指定日期待办事项标记:日期不在本地写死,而是从接口获取的情况下,点击待办事项后,标记点会消失
如果获取当前的时间?我用你文档里面的引入方式就报错了,怎么回事?还有我想请教一下 怎么给当前时间上面赋值?要动态赋值对应的时间
目前就是太生硬了,可否添加一个动画效果
左右滑动可以切换月份,上下滑动则应支持切换年份
当点击左右箭头选择月份时,有没有事件能捕获到月份
首先感谢作者的辛苦。
希望能增加以下功能:
1.日历视图中相应日期有无事件的标志,可设置参数开启或关闭;
2.增加对日历视图背景、文字、选中时等状态颜色自定义主题的功能。
再次感谢作者。
怎么获取到点击的日期呢?
const conf = {
multi: false,
onTapDay(currentSelect, event) {
getSelectedDay();
},
};
这么写没反应,而且用onTapDay点击后背景色不会到选中的那个日期
日期选择器选择过去的日子麻烦,把年、月分别用箭头跳转会方便不少,大致是这个样子:
《 五月》 《 2018 》
这很容易实现吧?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.