fix: add correct language for datepicker
This commit is contained in:
parent
42d831892a
commit
916aa2fd9c
@ -2,7 +2,7 @@ import {Component} from '@angular/core';
|
||||
import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from "@angular/forms";
|
||||
import {NavigationService} from "@service/navigation.service";
|
||||
import SetupService from "@api/v1/setup.service";
|
||||
import {MAT_DATE_LOCALE, MatNativeDateModule} from "@angular/material/core";
|
||||
import {DateAdapter, MatNativeDateModule} from "@angular/material/core";
|
||||
import {MatFormFieldModule} from "@angular/material/form-field";
|
||||
import {MatSelectModule} from "@angular/material/select";
|
||||
import {MatInput} from "@angular/material/input";
|
||||
@ -26,13 +26,17 @@ import {MatDatepickerModule} from "@angular/material/datepicker";
|
||||
MatNativeDateModule
|
||||
],
|
||||
templateUrl: './schedule.component.html',
|
||||
providers: [{provide: MAT_DATE_LOCALE, useValue: 'ru-RU'}]
|
||||
})
|
||||
|
||||
export class ScheduleComponent {
|
||||
protected scheduleSettings!: FormGroup;
|
||||
|
||||
constructor(private navigationService: NavigationService, formBuilder: FormBuilder, private api: SetupService) {
|
||||
constructor(
|
||||
private navigationService: NavigationService,
|
||||
formBuilder: FormBuilder,
|
||||
private api: SetupService,
|
||||
adapter: DateAdapter<any>) {
|
||||
adapter.setLocale(navigator.language);
|
||||
this.scheduleSettings = formBuilder.group({
|
||||
cron: ['0 */6 * * *', Validators.pattern(/^(\S+\s){4}\S$/)],
|
||||
startTerm: ['', Validators.required]
|
||||
|
Loading…
Reference in New Issue
Block a user