feat: add "Hoje" preset to corporate dashboard
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -488,6 +488,7 @@ ${buildHeader({ role: role, userName: user.nome, activePage: 'dashboard' })}
|
||||
<div class="filter-bar">
|
||||
<span class="filter-bar-label">Periodo:</span>
|
||||
<div class="filter-presets">
|
||||
<button class="preset-btn" data-preset="hoje">Hoje</button>
|
||||
<button class="preset-btn active" data-preset="thisMonth">Este Mes</button>
|
||||
<button class="preset-btn" data-preset="lastMonth">Mes Anterior</button>
|
||||
<button class="preset-btn" data-preset="last2Months">Ultimos 2 Meses</button>
|
||||
@@ -555,7 +556,10 @@ let charts = {};
|
||||
function getPresetDates(preset) {
|
||||
const now = new Date();
|
||||
let inicio, fim;
|
||||
if (preset === 'thisMonth') {
|
||||
if (preset === 'hoje') {
|
||||
inicio = now;
|
||||
fim = now;
|
||||
} else if (preset === 'thisMonth') {
|
||||
inicio = new Date(now.getFullYear(), now.getMonth(), 1);
|
||||
fim = now;
|
||||
} else if (preset === 'lastMonth') {
|
||||
|
||||
Reference in New Issue
Block a user