Skip to content

Commit

Permalink
añadido ultimos 3 dias al selector de fecha
Browse files Browse the repository at this point in the history
  • Loading branch information
jortilles committed May 31, 2023
1 parent e204036 commit 92c134b
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
9 changes: 8 additions & 1 deletion eda/eda_app/src/app/services/utils/date-utils.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class DateUtils {
case 'monthFullPreviousYear': return this.setMonthFullPreviousYear();
case 'yearStart': return this.setYearStart();
case 'yearStartPreviousYear': return this.setYearStartPreviousYear();
case 'last3': return this.setLast3();
case 'last7': return this.setLast7();
case 'last15': return this.setLast15();
case 'last30': return this.setLast30();
Expand Down Expand Up @@ -163,12 +164,18 @@ export class DateUtils {
return [yearStart, today];
}

public setLast3(): Array<Date> {
const today = new Date();
const last3 = new Date(today.getTime() - (2 * 24 * 60 * 60 * 1000));
return [last3, today];
}

public setLast7(): Array<Date> {
const today = new Date();
const last7 = new Date(today.getTime() - (6 * 24 * 60 * 60 * 1000));
return [last7, today];
}

public setLast15(): Array<Date> {
const today = new Date();
const last15 = new Date(today.getTime() - (14 * 24 * 60 * 60 * 1000));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,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`:@@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' },
{ label: $localize`:@@DatePickerLast30:Últimos 30 días`, value: 'last30' },
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 @@ -2792,6 +2792,10 @@ Entrar<x id="CLOSE_BOLD_TEXT" ctype="x-b" equiv-text="&lt;/b&gt;"/>
<source> Últimos 7 días </source>
<target>Últims 7 dies </target>
</trans-unit>
<trans-unit id="DatePickerLast3">
<source> Últimos 3 días </source>
<target>Últims 3 dies </target>
</trans-unit>
<trans-unit id="DatePickerLast15">
<source> Últimos 15 días </source>
<target>Últims 15 dies </target>
Expand Down
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 @@ -2788,6 +2788,10 @@ Login<x id="CLOSE_BOLD_TEXT" ctype="x-b" equiv-text="&lt;/b&gt;"/>
<source> Últimos 7 días </source>
<target>Last 7 days </target>
</trans-unit>
<trans-unit id="DatePickerLast3">
<source> Últimos 3 días </source>
<target>Last 3 days </target>
</trans-unit>
<trans-unit id="DatePickerLast15">
<source> Últimos 15 días </source>
<target>Last 15 days </target>
Expand Down
4 changes: 4 additions & 0 deletions eda/eda_app/src/locale/messages.pl.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -2768,6 +2768,10 @@ Login<x id="CLOSE_BOLD_TEXT" ctype="x-b" equiv-text="&lt;/b&gt;"/>
<source> Últimos 7 días </source>
<target>Last 7 days </target>
</trans-unit>
<trans-unit id="DatePickerLast3">
<source> Últimos 3 días </source>
<target>Last 3 days </target>
</trans-unit>
<trans-unit id="DatePickerLast15">
<source> Últimos 15 días </source>
<target>Last 15 days </target>
Expand Down

0 comments on commit 92c134b

Please sign in to comment.