mirror of https://github.com/Chocobozzz/PeerTube
Use new primeng i18n api
parent
5b9b403a20
commit
8e0a2f2a05
|
@ -1,12 +1,12 @@
|
||||||
import { Injectable } from '@angular/core'
|
import { Injectable } from '@angular/core'
|
||||||
|
import { PrimeNGConfig } from 'primeng/api'
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class I18nPrimengCalendarService {
|
export class I18nPrimengCalendarService {
|
||||||
private readonly calendarLocale: any = {}
|
private readonly calendarLocale: any = {}
|
||||||
|
|
||||||
constructor () {
|
constructor (private config: PrimeNGConfig) {
|
||||||
this.calendarLocale = {
|
this.config.setTranslation({
|
||||||
firstDayOfWeek: 0,
|
|
||||||
dayNames: [
|
dayNames: [
|
||||||
$localize`Sunday`,
|
$localize`Sunday`,
|
||||||
$localize`Monday`,
|
$localize`Monday`,
|
||||||
|
@ -70,7 +70,7 @@ export class I18nPrimengCalendarService {
|
||||||
today: $localize`Today`,
|
today: $localize`Today`,
|
||||||
|
|
||||||
clear: $localize`Clear`
|
clear: $localize`Clear`
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
getCalendarLocale () {
|
getCalendarLocale () {
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
<label i18n for="schedulePublicationAt">Schedule publication ({{ calendarTimezone }})</label>
|
<label i18n for="schedulePublicationAt">Schedule publication ({{ calendarTimezone }})</label>
|
||||||
<p-calendar
|
<p-calendar
|
||||||
id="schedulePublicationAt" formControlName="schedulePublicationAt" [dateFormat]="calendarDateFormat"
|
id="schedulePublicationAt" formControlName="schedulePublicationAt" [dateFormat]="calendarDateFormat"
|
||||||
[locale]="calendarLocale" [minDate]="minScheduledDate" [showTime]="true" [hideOnDateTimeSelect]="true"
|
[firstDayOfWeek]="0" [minDate]="minScheduledDate" [showTime]="true" [hideOnDateTimeSelect]="true"
|
||||||
>
|
>
|
||||||
</p-calendar>
|
</p-calendar>
|
||||||
|
|
||||||
|
@ -299,8 +299,8 @@
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</my-help>
|
</my-help>
|
||||||
<p-calendar
|
<p-calendar
|
||||||
id="originallyPublishedAt" formControlName="originallyPublishedAt" [dateFormat]="calendarDateFormat"
|
id="originallyPublishedAt" formControlName="originallyPublishedAt" [dateFormat]="calendarDateFormat" [firstDayOfWeek]="0"
|
||||||
[locale]="calendarLocale" [showTime]="true" [hideOnDateTimeSelect]="true" [monthNavigator]="true" [yearNavigator]="true" [yearRange]="myYearRange"
|
[showTime]="true" [hideOnDateTimeSelect]="true" [monthNavigator]="true" [yearNavigator]="true" [yearRange]="myYearRange"
|
||||||
>
|
>
|
||||||
</p-calendar>
|
</p-calendar>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue