[FIX] web: fix the display of the time in year view popover
Currently, the time in popover of the year view does not appear with the title due to record.allday is undefined instead of false So in this commit, check if record.allday is not exist then display the time infront of the title instead of after the title. Related enterprise PR: https://github.com/odoo/enterprise/pull/19134 closes odoo/odoo#72440 Closes: #72440 Taskid: 2502339 Related: odoo/enterprise#19134 Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
This commit is contained in:
@@ -905,7 +905,7 @@ return AbstractRenderer.extend({
|
||||
const start = moment(event.extendedProps.r_start);
|
||||
const end = moment(event.extendedProps.r_end);
|
||||
const duration = moment.duration(end.diff(start)).asDays();
|
||||
event.extendedProps.record.start_hour = event.extendedProps.record.allday === false && duration < 1 ? start.format("HH:mm") : "";
|
||||
event.extendedProps.record.start_hour = !event.extendedProps.record.allday && duration < 1 ? start.format("HH:mm") : "";
|
||||
const key = this._getFormattedDate(start, end, false, event.extendedProps.record.allday);
|
||||
if (!(key in groupedEvents)) {
|
||||
groupedEvents[key] = [];
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
t-attf-class="o_cw_popover_link o_calendar_color_#{typeof color === 'number' ? _.str.sprintf('%s', color) : '1'} o_attendee_status_#{record.is_alone ? 'alone' : record.attendee_status} btn-link d-block"
|
||||
t-att-data-id="record.id"
|
||||
t-att-data-title="record.display_name">
|
||||
<t t-esc="record.display_name"/> <t t-esc="record.start_hour"/>
|
||||
<t t-esc="record.start_hour"/> <t t-esc="record.display_name"/>
|
||||
</a>
|
||||
</t>
|
||||
</t>
|
||||
|
||||
@@ -3877,7 +3877,7 @@ QUnit.module('Views', {
|
||||
assert.containsOnce(calendar, '.o_cw_popover');
|
||||
popoverText = calendar.el.querySelector('.o_cw_popover')
|
||||
.textContent.replace(/\s{2,}/g, ' ').trim();
|
||||
assert.strictEqual(popoverText, 'December 12, 2016 event 2 10:55 event 3 15:55');
|
||||
assert.strictEqual(popoverText, 'December 12, 2016 10:55 event 2 15:55 event 3');
|
||||
await testUtils.dom.click(calendar.el.querySelector('.o_cw_popover_close'));
|
||||
assert.containsNone(calendar, '.o_cw_popover');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user