Last active
June 27, 2017 17:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component, AfterViewInit, ViewChild, TemplateRef } from "@angular/core"; | |
| import { SuiLocalizationService } from "../../../../../src/util/services/localization.service"; | |
| @Component({ | |
| selector: "demo-page-test", | |
| templateUrl: "./test.page.html" | |
| }) | |
| export class TestPage { | |
| public date:Date = new Date(); | |
| public minDate:Date; | |
| public maxDate:Date; | |
| constructor(private _localizationService:SuiLocalizationService) { | |
| this.localizateMe(); | |
| const today = new Date(); | |
| console.log(`start component value new Date() = ${today} `); | |
| this.minDate = new Date(today.getFullYear(), today.getMonth() - 2); | |
| this.maxDate = new Date(today.getFullYear(), today.getMonth() + 10); | |
| console.log(`new Date(today.getFullYear(), today.getMonth() - 2) = ${this.minDate}`); | |
| console.log(`new Date(today.getFullYear(), today.getMonth() + 10) = ${this.maxDate}`); | |
| } | |
| public pickerSelectedDateChange(event:any):void { | |
| console.log(`pickerSelectedDateChange value ${event}`); | |
| console.log(`pickerSelectedDateChange current component value ${this.date}`); | |
| } | |
| public log(item:any):void { | |
| console.log(item); | |
| } | |
| public test():void { | |
| console.log(`btn current component value ${this.date}`); | |
| } | |
| public localizateMe():void { | |
| this._localizationService.setValues("ar", { | |
| datepicker: { | |
| months: [ | |
| "Enero", "Febrero", "Marzo", "Abril", | |
| "Mayo", "Junio", "Julio", "Agosto", | |
| "Septiembre", "Octubre", "Noviembre", "Diciembre" | |
| ], | |
| monthsShort: [ | |
| "Ene", "Feb", "Mar", "Abr", | |
| "May", "Jun", "Jul", "Ago", | |
| "Sep", "Oct", "Nov", "Dic" | |
| ], | |
| weekdays: [ | |
| "Domingo", "Lunes", "Martes", "Miércoles", | |
| "Jueves", "Viernes", "Sábado" | |
| ], | |
| weekdaysShort: [ | |
| "D", "L", "M", "M", | |
| "J", "V", "S" | |
| ], | |
| firstDayOfWeek: 0, | |
| formats: { | |
| time: "HH:mm", | |
| datetime: "DD-MMM-YYYY HH:mm", | |
| date: "DD-MMM-YYYY", | |
| month: "MMMM YYYY", | |
| year: "YYYY" | |
| } | |
| } | |
| }); | |
| this._localizationService.setLanguage("ar"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment