Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

language translation issue in sat-Datepicker #140

Open
sureshkuma opened this issue Apr 22, 2020 · 0 comments
Open

language translation issue in sat-Datepicker #140

sureshkuma opened this issue Apr 22, 2020 · 0 comments

Comments

@sureshkuma
Copy link

sureshkuma commented Apr 22, 2020

the issue while translating from english language to german language the value inside the input field is not translating into german language.am using sat-datepicker.we are using the angular 7 version.Any help
Files>>>>>>>>>>>>
component.html>>>

{{ 'REPORTSINFO.DEVICENAME' | translate }} {{ device.device_model_and_name }} {{'REPORTSINFO.DATERANGE' | translate }}

component.ts >>>>>

import {
Component,
Input,
Output,
EventEmitter,
OnChanges,
SimpleChanges,
OnInit
} from '@angular/core';
import { Device } from 'src/app/dashboard/models';
import { DateRange } from 'src/app/home/select-duration/models';
import { IDeviceRange } from './device-range';

@component({
selector: 'app-device-range',
templateUrl: './device-range.component.html',
styleUrls: ['./device-range.component.scss']
})
export class DeviceRangeComponent implements OnChanges, OnInit {

@input() devices: Device[] = [];
@input() selectedDevice: string;
@input() setDateSelectorResponsiveView: boolean;
@input() dateRange: DateRange = {
startDate: new Date(),
endDate: new Date(),
};

@output() deviceInfo = new EventEmitter();
rangeValue = {
begin: new Date(),
end: new Date(),
};
minDate: Date;
maxDate: Date;
device: Device;

constructor() { }

ngOnChanges(changes: SimpleChanges) {
if (changes) {
if (changes.dateRange) {
this.rangeValue = {
begin: changes.dateRange.currentValue.startDate,
end: changes.dateRange.currentValue.endDate
};
}
}
}

ngOnInit() {
this.initializeMinMaxDate();
}

initializeMinMaxDate() {
const previousDate = new Date();
const currentDate = new Date();
// End date is included in the count hence subtracting 30 only
previousDate.setDate(previousDate.getDate() - 30);
this.minDate = new Date(previousDate.getFullYear(), previousDate.getMonth(), previousDate.getDate());
this.maxDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate());
}

dateRangeChange(event) {
this.dateRange = {
startDate: event.value.begin,
endDate: event.value.end,
};
this.onDeviceChange();
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant