Search code examples
javascripterpnextjalali-calendar

ErpNext jalali calendar


How to add jalali clock and calendar to erpNext? Is there a way to manually add the jalali calendar to ErpNext?


Solution

  • You have to add lines to the below file.

    ~/frappe-bench/apps/frappe/frappe/public/js/frappe/form/controls/datepicker_i18n.js
    

    An example is here for the Turkish calendar:

    ;(function ($) { $.fn.datepicker.language['tr'] = {
        days: ['Pazar', 'Pazartesi', 'Salı', 'Çarşamba', 'Perşembe', 'Cuma', 'Cumartesi'],
        daysShort: ['Paz', 'Pzt', 'Sal', 'Çar', 'Per', 'Cum', 'Cmt'],
        daysMin: ['Pz', 'Pt', 'Sa', 'Ça', 'Pe', 'Cu', 'Ct'],
        months: ['Ocak','Şubat','Mart','Nisan','Mayıs','Haziran', 'Temmuz','Ağustos','Eylül','Ekim','Kasım','Aralık'],
        monthsShort: ['Oca', 'Şub', 'Mar', 'Nis', 'May', 'Haz', 'Tem', 'Ağu', 'Eyl', 'Eki', 'Kas', 'Ara'],
        today: 'Bugün',
        clear: 'Temizle',
        dateFormat: 'dd.mm.yyyy',
        timeFormat: 'hh:ii',
        firstDay: 1
    };
     })(jQuery);