Update JavaScript to support labels in readonly mode for both Gregorian and Hijri dates
This commit is contained in:
parent
ffe2251802
commit
885edd2d31
|
|
@ -125,14 +125,35 @@ odoo.define('web_hijri_datepicker.datepicker', function (require) {
|
|||
var value = this.value ? this.datewidget._formatClients(this.value) : '';
|
||||
var parsed_date = this.value ? this.datewidget._parseDate(this.value) : '';
|
||||
var hijri_value = parsed_date ? this.datewidget._convertGregorianToHijri(parsed_date) : '';
|
||||
|
||||
// Gregorian Date Section
|
||||
$('<div>', {
|
||||
class: this.$el.attr('class'),
|
||||
text: value,
|
||||
}).appendTo($div);
|
||||
class: 'o_date_section'
|
||||
}).append([
|
||||
$('<label>', {
|
||||
class: 'o_date_label o_gregorian_label',
|
||||
text: 'التاريخ الميلادي'
|
||||
}),
|
||||
$('<div>', {
|
||||
class: 'o_date_value ' + this.$el.attr('class'),
|
||||
text: value,
|
||||
})
|
||||
]).appendTo($div);
|
||||
|
||||
// Hijri Date Section
|
||||
$('<div>', {
|
||||
class: this.$el.attr('class'),
|
||||
text: hijri_value,
|
||||
}).appendTo($div);
|
||||
class: 'o_date_section'
|
||||
}).append([
|
||||
$('<label>', {
|
||||
class: 'o_date_label o_hijri_label',
|
||||
text: 'التاريخ الهجري'
|
||||
}),
|
||||
$('<div>', {
|
||||
class: 'o_date_value ' + this.$el.attr('class'),
|
||||
text: hijri_value,
|
||||
})
|
||||
]).appendTo($div);
|
||||
|
||||
this.datewidget.appendTo('<div>').then(function () {
|
||||
self._replaceElement($div);
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue