1var strDate = new Date(); // By default Date empty constructor give you Date.now
2var shortYear = strDate.getFullYear();
3// Add this line
4var twoDigitYear = shortYear.toString().substr(-2);
1const id = "ctl03_Tabs1";
2console.log(id.slice(id.length - 5)); //Outputs: Tabs1
3console.log(id.slice(id.length - 1)); //Outputs: 1
1 maskDate(date) {
2 // console.log(date);
3 var dateVar = new Date(date);
4 // console.log("XX/XX/"+ dateVar.getFullYear().toString().substr(-2));
5 return "XX/XX/"+ dateVar.getFullYear().toString().substr(-2);
6 }