blob: 53cec5a80cda578cd7e376a7180e98cd48f89642 [file] [log] [blame]
/********************************************************************************
* Copyright (c) 2015-2018 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
* information regarding copyright ownership.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
********************************************************************************/
import { Component, Input } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Attribute } from '@navigator/node';
import { ContextAttributeIdentifier } from '../../model/details.model';
@Component({
selector: 'attribute-editor',
templateUrl: './attribute-editor.component.html',
styleUrls: ['./attribute-editor.component.css']
})
export class AttributeEditorComponent {
@Input() ident: ContextAttributeIdentifier;
@Input() attribute: Attribute;
locale: any;
constructor(private translateService: TranslateService) {
// calendar localization
this.locale = {
firstDayOfWeek: 1,
dayNames: [this.translateService.instant('details.attribute-editor.cal-sunday'),
this.translateService.instant('details.attribute-editor.cal-monday'),
this.translateService.instant('details.attribute-editor.cal-tuesday'),
this.translateService.instant('details.attribute-editor.cal-wednesday'),
this.translateService.instant('details.attribute-editor.cal-thursday'),
this.translateService.instant('details.attribute-editor.cal-friday'),
this.translateService.instant('details.attribute-editor.cal-saturday')],
dayNamesShort: [this.translateService.instant('details.attribute-editor.cal-sun'),
this.translateService.instant('details.attribute-editor.cal-mon'),
this.translateService.instant('details.attribute-editor.cal-tue'),
this.translateService.instant('details.attribute-editor.cal-wed'),
this.translateService.instant('details.attribute-editor.cal-thu'),
this.translateService.instant('details.attribute-editor.cal-fri'),
this.translateService.instant('details.attribute-editor.cal-sat')],
dayNamesMin: [this.translateService.instant('details.attribute-editor.cal-su'),
this.translateService.instant('details.attribute-editor.cal-mo'),
this.translateService.instant('details.attribute-editor.cal-tu'),
this.translateService.instant('details.attribute-editor.cal-we'),
this.translateService.instant('details.attribute-editor.cal-th'),
this.translateService.instant('details.attribute-editor.cal-fr'),
this.translateService.instant('details.attribute-editor.cal-sa')],
monthNames: [this.translateService.instant('details.attribute-editor.cal-january'),
this.translateService.instant('details.attribute-editor.cal-february'),
this.translateService.instant('details.attribute-editor.cal-march'),
this.translateService.instant('details.attribute-editor.cal-april'),
this.translateService.instant('details.attribute-editor.cal-may'),
this.translateService.instant('details.attribute-editor.cal-june'),
this.translateService.instant('details.attribute-editor.cal-july'),
this.translateService.instant('details.attribute-editor.cal-august'),
this.translateService.instant('details.attribute-editor.cal-september'),
this.translateService.instant('details.attribute-editor.cal-october'),
this.translateService.instant('details.attribute-editor.cal-november'),
this.translateService.instant('details.attribute-editor.cal-december')],
monthNamesShort: [this.translateService.instant('details.attribute-editor.cal-jan'),
this.translateService.instant('details.attribute-editor.cal-feb'),
this.translateService.instant('details.attribute-editor.cal-mar'),
this.translateService.instant('details.attribute-editor.cal-apr'),
this.translateService.instant('details.attribute-editor.cal-may'),
this.translateService.instant('details.attribute-editor.cal-jun'),
this.translateService.instant('details.attribute-editor.cal-jul'),
this.translateService.instant('details.attribute-editor.cal-aug'),
this.translateService.instant('details.attribute-editor.cal-sep'),
this.translateService.instant('details.attribute-editor.cal-oct'),
this.translateService.instant('details.attribute-editor.cal-nov'),
this.translateService.instant('details.attribute-editor.cal-dec')],
today: this.translateService.instant('details.attribute-editor.cal-today'),
clear: this.translateService.instant('details.attribute-editor.cal-clear'),
dateFormat: this.translateService.instant('details.attribute-editor.cal-format'),
weekHeader: this.translateService.instant('details.attribute-editor.cal-week')
};
}
}