diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-07 15:05:16 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-12-07 16:07:00 +0100 |
commit | 8e0a2f2a05df23c30abb21cfbd540fc289c33b91 (patch) | |
tree | 58a0e569ba4816af6e4a49798333cac46f654123 /client/src/app/+videos | |
parent | 5b9b403a206e84342edfff536f0b30167976e80e (diff) | |
download | PeerTube-8e0a2f2a05df23c30abb21cfbd540fc289c33b91.tar.gz PeerTube-8e0a2f2a05df23c30abb21cfbd540fc289c33b91.tar.zst PeerTube-8e0a2f2a05df23c30abb21cfbd540fc289c33b91.zip |
Use new primeng i18n api
Diffstat (limited to 'client/src/app/+videos')
-rw-r--r-- | client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts | 8 | ||||
-rw-r--r-- | client/src/app/+videos/+video-edit/shared/video-edit.component.html | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts b/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts index 2acbace48..6ef4dbc68 100644 --- a/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts +++ b/client/src/app/+videos/+video-edit/shared/i18n-primeng-calendar.service.ts | |||
@@ -1,12 +1,12 @@ | |||
1 | import { Injectable } from '@angular/core' | 1 | import { Injectable } from '@angular/core' |
2 | import { PrimeNGConfig } from 'primeng/api' | ||
2 | 3 | ||
3 | @Injectable() | 4 | @Injectable() |
4 | export class I18nPrimengCalendarService { | 5 | export class I18nPrimengCalendarService { |
5 | private readonly calendarLocale: any = {} | 6 | private readonly calendarLocale: any = {} |
6 | 7 | ||
7 | constructor () { | 8 | constructor (private config: PrimeNGConfig) { |
8 | this.calendarLocale = { | 9 | this.config.setTranslation({ |
9 | firstDayOfWeek: 0, | ||
10 | dayNames: [ | 10 | dayNames: [ |
11 | $localize`Sunday`, | 11 | $localize`Sunday`, |
12 | $localize`Monday`, | 12 | $localize`Monday`, |
@@ -70,7 +70,7 @@ export class I18nPrimengCalendarService { | |||
70 | today: $localize`Today`, | 70 | today: $localize`Today`, |
71 | 71 | ||
72 | clear: $localize`Clear` | 72 | clear: $localize`Clear` |
73 | } | 73 | }) |
74 | } | 74 | } |
75 | 75 | ||
76 | getCalendarLocale () { | 76 | getCalendarLocale () { |
diff --git a/client/src/app/+videos/+video-edit/shared/video-edit.component.html b/client/src/app/+videos/+video-edit/shared/video-edit.component.html index 4747cec27..0c60ec4ec 100644 --- a/client/src/app/+videos/+video-edit/shared/video-edit.component.html +++ b/client/src/app/+videos/+video-edit/shared/video-edit.component.html | |||
@@ -117,7 +117,7 @@ | |||
117 | <label i18n for="schedulePublicationAt">Schedule publication ({{ calendarTimezone }})</label> | 117 | <label i18n for="schedulePublicationAt">Schedule publication ({{ calendarTimezone }})</label> |
118 | <p-calendar | 118 | <p-calendar |
119 | id="schedulePublicationAt" formControlName="schedulePublicationAt" [dateFormat]="calendarDateFormat" | 119 | id="schedulePublicationAt" formControlName="schedulePublicationAt" [dateFormat]="calendarDateFormat" |
120 | [locale]="calendarLocale" [minDate]="minScheduledDate" [showTime]="true" [hideOnDateTimeSelect]="true" | 120 | [firstDayOfWeek]="0" [minDate]="minScheduledDate" [showTime]="true" [hideOnDateTimeSelect]="true" |
121 | > | 121 | > |
122 | </p-calendar> | 122 | </p-calendar> |
123 | 123 | ||
@@ -299,8 +299,8 @@ | |||
299 | </ng-template> | 299 | </ng-template> |
300 | </my-help> | 300 | </my-help> |
301 | <p-calendar | 301 | <p-calendar |
302 | id="originallyPublishedAt" formControlName="originallyPublishedAt" [dateFormat]="calendarDateFormat" | 302 | id="originallyPublishedAt" formControlName="originallyPublishedAt" [dateFormat]="calendarDateFormat" [firstDayOfWeek]="0" |
303 | [locale]="calendarLocale" [showTime]="true" [hideOnDateTimeSelect]="true" [monthNavigator]="true" [yearNavigator]="true" [yearRange]="myYearRange" | 303 | [showTime]="true" [hideOnDateTimeSelect]="true" [monthNavigator]="true" [yearNavigator]="true" [yearRange]="myYearRange" |
304 | > | 304 | > |
305 | </p-calendar> | 305 | </p-calendar> |
306 | 306 | ||