1

I am working on weather application where I want to show Current week weather detail and I am getting all data from server.

but what I want is on Today and Tomorrow date I want to show "Today" & "Tomorrow" text.

UI:

enter image description here

I have done below logic but unable to get it done.

I am comparing today date with server provided date and if both are same I will show "Today" string.

.ts

this.today = new Date();
this.dateString = this.today.toString()

HTML

 <th colspan="2" class="thStyle">{{ item.applicable_date === dateString ? "Today" : "Today" }}</th>
CodeChanger
  • 7,953
  • 5
  • 49
  • 80

1 Answers1

2

Conver the date to the particular format

this.dateString = new Date().toISOString().slice(0,10);
Sajeetharan
  • 216,225
  • 63
  • 350
  • 396