Datepicker for jQuery mobile (Android)

前端 未结 4 890
小蘑菇
小蘑菇 2021-01-03 15:26

Okay, I know this question has been asked before, but which date picker is best for jQuery mobile (for Android?)

Datebox http://dev.jtsage.com/jQM-DateBox2/

4条回答
  •  爱一瞬间的悲伤
    2021-01-03 15:55

    From my experience you should choose between Mobi Pick and Mobiscroll.

    Datebox

    I found some Datebox rendering problems on my previous android phone (galaxy S2), other then that Datebox is close to Mobi Pick (performance vise + configuration potential). Main difference between Datebox and Mobi Pick is final design.

    Working jsFiddle example: http://jsfiddle.net/Gajotres/ktbcP/

    
    

    Mobiscroll

    Mobiscroll has much more options and skins. It can be much better integrated into jQM and it has much better responsive UI, unfortunately it has performance problems on 2.X android phones (no problem with iPhone devices).

    Working jsFiddle example: http://jsfiddle.net/Gajotres/WDjfR/

    $(document).on('pagebeforeshow', '#index', function(){       
        $('#demo').mobiscroll().date({
            invalid: { daysOfWeek: [0, 6], daysOfMonth: ['5/1', '12/24', '12/25'] },
            theme: 'android-ics',
            display: 'inline',
            mode: 'scroller',
            dateOrder: 'dd mm yy',
            dateFormat : "dd-mm-yy"
        });  
    });
    

    Mobipick

    I would pick Mobi Pick over Mobiscroll in case you are satisfied with its UI look. If you are not use Mobiscroll instead.

    Working jsFiddle example: http://jsfiddle.net/Gajotres/zyVjE/

    $(document).on('pagebeforeshow', '#index', function(){       
        $('#demo').mobipick({
            dateFormat: "MM-dd-yyyy"
        });
    });
    

    More info

    Detailed overview and examples can be found here.

提交回复
热议问题