I’m trying to get month from localStorage
, which i have saved in some other page. I want to compare months.
<ion-datetime displayFormat="DD/MMM/YY" [(ngModel)]="date"></ion-datetime>
localStorage.setItem('date'+this.index, data);
This is how I’m getting date.
l
let data = localStorage.getItem('date' + this.index);
let data1 = JSON.parse(data)
for(let value of data1){
console.log(value.date)
}
Console Value:
2019-11-17
2019-11-16
I want to select the month from this. Is this possible in ionic, or i have to use moment.js
Thank you.