2024-09-19 11:52:09 -04:00
|
|
|
BX.addCustomEvent('Kanban.Grid:onRender', grid => {
|
|
|
|
if (grid.getData().entityType != 'DYNAMIC_183')
|
|
|
|
return;
|
|
|
|
|
|
|
|
const items = grid.getItems();
|
|
|
|
|
|
|
|
for (let key in items) {
|
|
|
|
if (key < 1) continue;
|
|
|
|
const item = items[key];
|
|
|
|
if (!('data' in item) || !('dateCreate' in item.data)) continue;
|
2024-09-20 02:21:06 -04:00
|
|
|
const HOUR = 1000 * 60 * 60;
|
|
|
|
const pattern = /^(\d{2})\.(\d{2})\.(\d{4})\s(\d{2})\:(\d{2})\:(\d{2})$/;
|
|
|
|
const createdDate = new Date(item.data.dateCreate.replace(pattern,'$3-$2-$1 $4:$5:$6'));
|
|
|
|
if ((Date.now() - createdDate) >= HOUR * 48) {
|
2024-09-19 11:52:09 -04:00
|
|
|
BX.addClass(item.container, 'kanban-color-bg-animate');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|