Merge pull request #4393 from expsa/eltayar

🔧 Add Minimal Placeholder Fix for Gregorian Date Field
This commit is contained in:
Mohamed Eltayar 2025-08-29 01:00:36 +03:00 committed by GitHub
commit 9b932f3e3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -37,6 +37,11 @@ odoo.define('web_hijri_datepicker.datepicker', function (require) {
this.$input = this.$('input.o_datepicker_input');
this.$input_hijri = this.$('input.o_hijri');
// ✅ إضافة بسيطة للـ placeholder للحقل الميلادي
if (this.$input && this.$input.length && !this.$input.attr('placeholder')) {
this.$input.attr('placeholder', 'التاريخ الميلادي');
}
// Enhanced click handler with better UX
this.$input_hijri.click(function (e) {
e.preventDefault();
@ -70,6 +75,13 @@ odoo.define('web_hijri_datepicker.datepicker', function (require) {
this.$el.datetimepicker(this.options);
this.__libInput--;
this._setReadonly(false);
// ✅ تأكد مرة أخيرة من الـ placeholder بعد تحميل datetimepicker
setTimeout(function() {
if (self.$input && self.$input.length && !self.$input.attr('placeholder')) {
self.$input.attr('placeholder', 'التاريخ الميلادي');
}
}, 50);
},
/**