smalot / bootstrap-datetimepicker

Both Date and Time picker widget based on twitter bootstrap (supports Bootstrap v2 and v3)
http://www.malot.fr/bootstrap-datetimepicker/
Apache License 2.0
3.49k stars 1.65k forks source link

How about add support for persian(Jalali) calendar? #116

Open MiladQamari opened 11 years ago

MiladQamari commented 11 years ago

I need my calendar to support Persian (jalali) . I saw someone do the same things for jquery ui date picker , here is the link http://hasheminezhad.com/datepicker

smalot commented 11 years ago

I suggest you to duplicate an existing language file and alter it with persian texts.

MiladQamari commented 11 years ago

there are so many differences between Gregorian calendar and Persian(Jalali) calendar , for example leap year or days of months , .... . so I added support for dynamic calendar simply by adding the localDate object to datetimepicker therefor it can work with every calendar like Arabic , Persian (Jalali), Gregorian, ....

here are files : jalali calendar convertor jalali date object fa language file bootstrap-datetimepicker (add support for local calendar)

$('input[type="persiandate"]').datetimepicker({
            format: 'yyyy-mm-dd',
            autoclose: true,
            minView: 2,
            todayBtn: true,
            todayHighlight: true,
            language: 'fa',
            localDate: JalaliDate
        });
behrad commented 10 years ago

I can't get your example working @MiladQamari @smalot Can u please review Milad's patch to see if you can add an inject-able calendar support?

elenorgt500 commented 9 years ago

Hello

can anyone help me? i can not find any converntor to jalali for datetimepicker, can you help me?

MiladQamari commented 9 years ago

here are new address for files : jalali calendar convertor jalali date object fa language file bootstrap-datetimepicker (add support for local calendar)

elenorgt500 commented 9 years ago

hello

can i call any format of this datetimepicker? for example how to call time format or datetime format ?

thanks

MiladQamari commented 9 years ago

hello

// time format : 
        this.$().datetimepicker({
            format: 'hh:ii',
            autoclose: true,
            minView: 0,
            maxView: 1,
            startView: 1,
            todayBtn: true,
            todayHighlight: true
        });
// year format
this.$().datetimepicker({
            format: 'yyyy',
            autoclose: true,
            minView: 4,
            startView: 4,
            todayBtn: true,
            todayHighlight: true,
            language: 'fa',
            localDate: JalaliDate
        });

// date format 
        this.$().datetimepicker({
            format: 'yyyy-mm-dd',
            autoclose: true,
            minView: 2,
            todayBtn: true,
            todayHighlight: true,
            language: 'fa',
            localDate: JalaliDate
        });
arminjgh commented 9 years ago

dear milad bootstrap datetimepicker (add support for local ) not work please fix it

ghominejad commented 8 years ago

+1