Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement - APP - Incluir filtro "Año pasado completo" #192

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions eda/eda_app/src/app/services/utils/date-utils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class DateUtils {
case 'monthFullPreviousYear': return this.setMonthFullPreviousYear();
case 'yearStart': return this.setYearStart();
case 'yearStartPreviousYear': return this.setYearStartPreviousYear();
case 'yearStartPreviousYearFull': return this.setYearStartPreviousYearFull();
case 'last3': return this.setLast3();
case 'last7': return this.setLast7();
case 'last15': return this.setLast15();
Expand Down Expand Up @@ -170,6 +171,12 @@ export class DateUtils {
return [yearStart, today];
}

public setYearStartPreviousYearFull(): Array<Date> {
const pastYearStart = moment().subtract(1,'years').startOf('year').toDate();
const pastYearEnd = moment().subtract(1,'years').endOf('year').toDate();
return [pastYearStart, pastYearEnd];
}

public setLast3(): Array<Date> {
const today = new Date();
const last3 = new Date(today.getTime() - (2 * 24 * 60 * 60 * 1000));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class EdaDatePickerComponent implements OnChanges {
{ label: $localize`:@@DatePickerMonthPreviousYearFull:Éste mes al completo del año pasado`, value: 'monthFullPreviousYear' },
{ label: $localize`:@@DatePickerYear:Éste año`, value: 'yearStart' },
{ label: $localize`:@@DatePickerYearPreviousYear:El año pasado`, value: 'yearStartPreviousYear' },
{ label: $localize`:@@DatePickerYearPreviousYearFull:El año pasado, completo`, value: 'yearStartPreviousYearFull' },
{ label: $localize`:@@DatePickerLast3:Últimos 3 días`, value: 'last3' },
{ label: $localize`:@@DatePickerLast7:Últimos 7 días`, value: 'last7' },
{ label: $localize`:@@DatePickerLast15:Últimos 15 días`, value: 'last15' },
Expand Down
4 changes: 4 additions & 0 deletions eda/eda_app/src/locale/messages.ca.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4303,6 +4303,10 @@
<source>Alias del filtro (opcional)</source>
<target>Alias del filtre (opcional)</target>
</trans-unit>
<trans-unit id="DatePickerYearPreviousYearFull">
<source>El año pasado, completo</source>
<target>L'any passat, complet</target>
</trans-unit>
</body>
</file>
</xliff>
4 changes: 4 additions & 0 deletions eda/eda_app/src/locale/messages.en.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4277,6 +4277,10 @@
<source>Alias del filtro (opcional)</source>
<target>Filter alias (optional)</target>
</trans-unit>
<trans-unit id="DatePickerYearPreviousYearFull">
<source>El año pasado, completo</source>
<target>Last year, complete</target>
</trans-unit>
</body>
</file>
</xliff>
5 changes: 5 additions & 0 deletions eda/eda_app/src/locale/messages.es.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4306,6 +4306,11 @@
<source>Alias del filtro (opcional)</source>
<target>Alias del filtro (opcional)</target>
</trans-unit>

<trans-unit id="DatePickerYearPreviousYearFull">
<source>El año pasado, completo</source>
<target>El año pasado, completo</target>
</trans-unit>
</body>
</file>
</xliff>
6 changes: 6 additions & 0 deletions eda/eda_app/src/locale/messages.gl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -4307,6 +4307,12 @@
<source>Alias del filtro (opcional)</source>
<target>Filtrar alias (opcional)</target>
</trans-unit>

<trans-unit id="DatePickerYearPreviousYearFull">
<source>El año pasado, completo</source>
<target>El año pasado, completo</target>
</trans-unit>

</body>
</file>
</xliff>
5 changes: 5 additions & 0 deletions eda/eda_app/src/locale/messages.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -3930,6 +3930,11 @@ Login<x id="CLOSE_BOLD_TEXT" ctype="x-b" equiv-text="&lt;/b&gt;"/>
<source>Alias del filtro (opcional)</source>
<target>Alias ​​filtra (opcjonalnie)</target>
</trans-unit>

<trans-unit id="DatePickerYearPreviousYearFull">
<source>El año pasado, completo</source>
<target>W zeszłym roku, kompletne</target>
</trans-unit>
</body>
</file>
</xliff>