Update JavaScript to support label layout in readonly mode matching the new structure
This commit is contained in:
parent
b24a733f24
commit
1375ec9270
|
|
@ -126,33 +126,32 @@ odoo.define('web_hijri_datepicker.datepicker', function (require) {
|
|||
var parsed_date = this.value ? this.datewidget._parseDate(this.value) : '';
|
||||
var hijri_value = parsed_date ? this.datewidget._convertGregorianToHijri(parsed_date) : '';
|
||||
|
||||
// Gregorian Date Section
|
||||
// Original Gregorian date (unchanged)
|
||||
$('<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);
|
||||
class: this.$el.attr('class'),
|
||||
text: value,
|
||||
}).appendTo($div);
|
||||
|
||||
// Hijri date with label layout
|
||||
var $hijriContainer = $('<div>', {
|
||||
class: 'o_hijri_readonly_container'
|
||||
});
|
||||
|
||||
var $hijriRow = $('<div>', {
|
||||
class: 'o_hijri_readonly_row'
|
||||
}).appendTo($hijriContainer);
|
||||
|
||||
// Hijri Date Section
|
||||
$('<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);
|
||||
class: 'o_hijri_readonly_label',
|
||||
text: 'التاريخ الهجري:'
|
||||
}).appendTo($hijriRow);
|
||||
|
||||
$('<div>', {
|
||||
class: 'o_hijri_readonly_value ' + this.$el.attr('class'),
|
||||
text: hijri_value,
|
||||
}).appendTo($hijriRow);
|
||||
|
||||
$hijriContainer.appendTo($div);
|
||||
|
||||
this.datewidget.appendTo('<div>').then(function () {
|
||||
self._replaceElement($div);
|
||||
|
|
|
|||
Loading…
Reference in New Issue