Skip to content

Commit

Permalink
Added translation (IT) for the next run date in the job list
Browse files Browse the repository at this point in the history
  • Loading branch information
ulver2812 committed Mar 12, 2019
1 parent c76003a commit 8cd6aa7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/app/components/jobs-list/jobs-list.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ <h4 mat-line>{{job.name}}</h4>
{{'PAGES.EDIT-JOB.FIELDS.MAX-EXECUTION-TIME-MINUTES' | translate}} = {{maxExecutionTimeHours[jobIndex]}} {{'PAGES.EDIT-JOB.FIELDS.MAX-EXECUTION-TIME-HOURS' | translate}}
</span>
<span *ngIf="job.type !== jobType.OneTime && job.status !== jobStatus.Terminated">
- <strong>{{ 'PAGES.JOB-LIST.NEXT-RUN' | translate }}: </strong> <span *ngIf="scheduledJobs[job.id]; else no_next_run">{{scheduledJobs[job.id]}}</span>
<br/>
<strong>{{ 'PAGES.JOB-LIST.NEXT-RUN' | translate }}: </strong> <span *ngIf="scheduledJobs[job.id]; else no_next_run">{{scheduledJobs[job.id]}}</span>
<ng-template #no_next_run> {{ 'PAGES.JOB-LIST.NO-NEXT-RUN' | translate }}</ng-template>
</span>
</p>
Expand Down
5 changes: 4 additions & 1 deletion src/app/providers/job-scheduler.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {AwsService} from './aws.service';
import * as chokidar from 'chokidar';
import {LogService} from './log.service';
import {LogType} from '../enum/log.type.enum';
import {TranslateService} from '@ngx-translate/core';

@Injectable({
providedIn: 'root'
Expand All @@ -23,7 +24,8 @@ export class JobSchedulerService {
private jobService: JobsService,
private cronService: CronService,
private awsService: AwsService,
private logService: LogService
private logService: LogService,
private translate: TranslateService,
) {
this.scheduledJobs = [];
}
Expand Down Expand Up @@ -171,6 +173,7 @@ export class JobSchedulerService {

getScheduledJobsFormattedTime(): Array<string> {
const res = [];
moment.locale(this.translate.currentLang);
this.scheduledJobs.forEach((scheduledJob) => {
if (scheduledJob.scheduler instanceof schedule.Job && scheduledJob.scheduler.nextInvocation() !== null) {
res[scheduledJob.jobId] = (moment(scheduledJob.scheduler.nextInvocation().toISOString()).format('LLLL'));
Expand Down

0 comments on commit 8cd6aa7

Please sign in to comment.