日期组件怎么控制范围?

小程序 文章 2020-07-31 17:41 698 0 全屏看文

AI助手支持GPT4.0

日期组件怎么控制范围?

我用了picker组件来选取日期,当选择日期时,考虑到开始日期应小于结束日期,结束日期大于开始日期,做了控制,也实现了这个预期。

但我发现日期的显示范围没法控制,例如:我选择开始日期2020-6-35,那么结束日期应该从2020-6-35以后,才显示且用来选择,但我做不到。

我尝试做判断,但判断后的显示我不知道怎样才能正确显示??


I used the picker component to select the date. When selecting the date, considering that the start date should be less than the end date, and the end date should be greater than the start date, I made the control and realized this expectation. But I found that the display range of the date can't be controlled. For example, if I choose the start date 2020-6-35, then the end date should be displayed and used for selection after June 35, 2020, but I can't. I try to make a judgment, but I don't know how to display it correctly??

回答:

Admin²⁰²⁰:
默认的picker组件日期的显示范围没法控制,但是会禁止选择startend外的日期。也算够用了。或者用第三方日期选择组件来达到更高的需求
Distance:

不用想太多,第一个的end=第二个的start,你改了第一个的end,第二个的start也会跟着改变。

_天马行空_:

你这样,你选择的结束日期如果在开始日期之前,把你的选的结束当开始日期,结束日期重新选

🔥👦👔👖:

附上代码片段

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
想请问这种算不算多级分销?
wx.previewImage会触发小程序的onHide,onHide里面有业务逻辑怎么办?
微信小程序如何实现分享到朋友圈功能?
刚上线网站被微信限制访问,要怎么处理?
小程序如何打开http 网址?
随便看看
小程序测试号解绑之后,扫一扫小程序登录又回来了 2101
微信公众号openid? 2347
微信开放平台跟公众平台有什么区别? 3608
怎么添加小程序支付功能? 4516
教育科技公司申请微信支付被拒绝? 4798
微信公众号免300认证教程 5892
小程序已经上线,作为管理员无法在小程序数据助手查看数据? 5299
小程序广告组件通过审核,但是小程序内没有显示广告? 5067
企业微信通讯录账号被管理员误/恶意删除,怎么办? 9568
问题? 9048