Replacing Datepicker - how do I do this?

Hello folk

I am new to this amazing environment.
Could someone tell me algorithmically, how to replace the datepicker of frappe with that of my own?

Many, many thanks in advance.


You will have to override the namespace frappe.ui.form.ControlDate with your own implementation.
The standard date picker code is at public/js/frappe/form/controls/date.js

1 Like

can you please provide us an example on how to “override” the namespace properly without breaking the future upgrade

1 Like

This explains ‘monkey patching’ to replace a class for eg DatePicker How to overwrite a imported python class for all calls - Stack Overflow

1 Like

Thanks, am a bit confused. The standard datepicker is here: /home/gelareh/frappe-bench/apps/frappe/frappe/public/js/lib/datepicker

isn’t it?
what is the relationship between date and datepicker? because I thought I am concerned with the datepicker but you are referring me to date?

Is that all correct?

datepicker is the library we use, date is the frappe abstraction over the library

My apologies, could you elaborate further a bit.
Well basically, I need to see the time in Hijri calendar.
Would you have any suggestion?

If I can replace it totally, I am happy, otherwise even if I can replace this with something similar to this one, such that my user only deals with Hujri calendar no matter what happens behind the seen (as long as the things remain consistent).


@gelareh any chance?