Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[(ngModel)]="initialYear"
[value]="year"
[invalid]="showErrorMessages"
[placeholder]='yearPlaceholder'
[placeholder]="'form.date-picker.placeholder.year' | translate"
(blur)="onBlur($event)"
(change)="onChange($event)"
(focus)="onFocus($event)"
Expand All @@ -29,7 +29,7 @@
[size]="6"
[(ngModel)]="initialMonth"
[value]="month"
[placeholder]="monthPlaceholder"
[placeholder]="'form.date-picker.placeholder.month' | translate"
[disabled]="!year || model.disabled"
(blur)="onBlur($event)"
(change)="onChange($event)"
Expand All @@ -45,7 +45,7 @@
[size]="2"
[(ngModel)]="initialDay"
[value]="day"
[placeholder]="dayPlaceholder"
[placeholder]="'form.date-picker.placeholder.day' | translate"
[disabled]="!month || model.disabled"
(blur)="onBlur($event)"
(change)="onChange($event)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
mockDynamicFormValidationService
} from '../../../../../testing/dynamic-form-mock-services';
import { By } from '@angular/platform-browser';
import { TranslateModule } from '@ngx-translate/core';


export const DATE_TEST_GROUP = new UntypedFormGroup({
Expand Down Expand Up @@ -51,7 +52,8 @@ describe('DsDatePickerComponent test suite', () => {

TestBed.configureTestingModule({
imports: [
NgbModule
NgbModule,
TranslateModule.forRoot(),
],
declarations: [
DsDatePickerComponent,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
} from '@ng-dynamic-forms/core';
import { DOCUMENT } from '@angular/common';
import isEqual from 'lodash/isEqual';
import { TranslateService } from '@ngx-translate/core';


export type DatePickerFieldType = '_year' | '_month' | '_day';
Expand Down Expand Up @@ -48,17 +49,14 @@ export class DsDatePickerComponent extends DynamicFormControlComponent implement
minDay = 1;
maxDay = 31;

yearPlaceholder = 'year';
monthPlaceholder = 'month';
dayPlaceholder = 'day';

disabledMonth = true;
disabledDay = true;

private readonly fields: DatePickerFieldType[] = ['_year', '_month', '_day'];

constructor(protected layoutService: DynamicFormLayoutService,
protected validationService: DynamicFormValidationService,
protected translateService: TranslateService,
private renderer: Renderer2,
@Inject(DOCUMENT) private _document: Document
) {
Expand Down
10 changes: 10 additions & 0 deletions src/assets/i18n/de.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5553,4 +5553,14 @@

// "workspace-item.delete.notification.error.content": "The workspace item could not be deleted",
"workspace-item.delete.notification.error.content": "Das Workspace-Item konnte nicht gelöscht werden.",


// "form.date-picker.placeholder.year": "Year",
"form.date-picker.placeholder.year": "Jahr",

// "form.date-picker.placeholder.month": "Month",
"form.date-picker.placeholder.month": "Monat",

// "form.date-picker.placeholder.day": "Day",
"form.date-picker.placeholder.day": "Tag",
}
6 changes: 6 additions & 0 deletions src/assets/i18n/en.json5
Original file line number Diff line number Diff line change
Expand Up @@ -1808,6 +1808,12 @@

"form.number-picker.increment": "Increment {{field}}",

"form.date-picker.placeholder.year": "Year",

"form.date-picker.placeholder.month": "Month",

"form.date-picker.placeholder.day": "Day",

"grant-deny-request-copy.deny": "Don't send copy",

"grant-deny-request-copy.email.back": "Back",
Expand Down