Every line of 'get current year javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
96 public getCurrentDate(): string { 97 /* Return current year(string) to display in calendar header. */ 98 return this.state.date.year().toString(); 99 }
Secure your code as it's written. Use Snyk Code to scan source code in minutes – no build needed – and fix issues immediately. Enable Snyk Code
66 private getStartingYear(year:number) { 67 // todo: parseInt 68 return ((year - 1) / this.datePicker.yearRange) * this.datePicker.yearRange + 1; 69 }
34 protected getYear(year: number): KeyValue { 35 const date = addYears(this.pageStart, year); 36 37 const classes = []; 38 if (year === 0 || year === 11) { 39 classes.push("date-other"); 40 } 41 if (this.config) { 42 if (isDate(this.config.date) && isSameYear(date, this.config.date)) { 43 classes.push("selected"); 44 } 45 46 if (isDisabled({ disabled: [], ...this.config }, date)) { 47 classes.push("disabled"); 48 } 49 } 50 51 return { date, label: format(date, "yyyy"), classes: classes.join(" ") }; 52 }
73 getSelectedYear() { 74 return $(this.rootElement) 75 .$('select') 76 .getValue(); 77 }
54 function onChangeYear() { 55 date.setFullYear($(this).val()); 56 update(); 57 }
129 public getCurrentYear() { 130 return new Date().getFullYear(); 131 }
36 get year(): number { 37 return getYear(this.fakeValue); 38 }
7 showCurrentYear() { 8 return new Date().getFullYear(); 9 }