Giter VIP home page Giter VIP logo

Comments (5)

progrape avatar progrape commented on August 18, 2024 2

这个有需求,我们考虑做得更加通用一些,不仅仅是当前以前时间

from weui.js.

progrape avatar progrape commented on August 18, 2024 2

@lrwbaron @mablevi 两位好,develop 分支我们更新了代码,datePicker 的 startend 选项增加支持传入 String 或者 Date 类型。

如果只需要选择今天以及今天往后的,那么 start 可以传入 new Date() 对象或者诸如 '2016-12-29' 格式的字符串。

同时,我们增加了可选的 cron 选项,如果需要支持复杂的日期选择,可以使用这个选项。完整的 cron 表达式有 6位,但是我们是日期选择,所以只使用了后 3位,分别是 dayOfMonth[1-31],month[1-12] 和 dayOfWeek[0-6](周日-周六)。

例如:今天以后的每个周末

weui.datePicker({
     start: new Date(), // 从今天开始
     end: 2030,
     cron: '* * 0,6',  // 每逢周日、周六
     onChange: function(result){
         console.log(result);
     },
     onConfirm: function(result){
         console.log(result);
     },
     id: 'datePicker'
 });

文档地址:https://github.com/weui/weui.js/blob/develop/docs/component/picker.md#datepickeroptions

from weui.js.

mablevi avatar mablevi commented on August 18, 2024

@progrape 请抓紧开发这个需求。

from weui.js.

progrape avatar progrape commented on August 18, 2024

@mablevi 大体开发完毕,在进行功能测试和性能测试

from weui.js.

BearJ avatar BearJ commented on August 18, 2024

现在v1.1.0 支持cron了

from weui.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.