10 examples of 'angular get current year' in JavaScript

Every line of 'angular get current year' 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.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
this disclaimer
129public getCurrentYear() {
130 return new Date().getFullYear();
131}
Important

Use secure code every time

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

96public getCurrentDate(): string {
97 /* Return current year(string) to display in calendar header. */
98 return this.state.date.year().toString();
99}
7showCurrentYear() {
8 return new Date().getFullYear();
9}
8getCurrentYear() {
9 return element(by.css('.signature .year')).getText();
10}
66private getStartingYear(year:number) {
67 // todo: parseInt
68 return ((year - 1) / this.datePicker.yearRange) * this.datePicker.yearRange + 1;
69}
39private getStartingYear(year: number) {
40 return (year - 1) / this.range * this.range + 1;
41}
73getSelectedYear() {
74 return $(this.rootElement)
75 .$('select')
76 .getValue();
77}
3currentYear () {
4 let dateToday = new Date()
5 let currentYear = dateToday.getFullYear()
6 return currentYear
7}
453private updateYearList() {
454 let startIndex = this.startYearIndex;
455 this.years = [];
456 const endIndex = startIndex + 32;
457 while (startIndex < endIndex) {
458 this.years.push({
459 year: startIndex,
460 disable: !this.canSelectYear(startIndex)
461 });
462 startIndex++;
463 }
464}
39private setCurrentYear(): void {
40 this.currentYear = new Date().getFullYear();
41}

Related snippets