Seems crazy but I cannot find a way to compare in an html created by jhipster test if a date field is greater than current date.
I try to display the date read from DB and see 2020-12-12 then I try to display the current date. Searching in the net I find it's possibile to get the current date doing: new Date(). So I try to display this but runnig the page an error is displayed:
ERROR Error: Uncaught (in promise): Error: Template parse errors:
Parser Error: Unexpected token 'Date' at column 5 in [ {{new Date()}} ] in...
how can I get the current date (for checking with the one read from db)?
Here the code of the myclass.component.html where I need to check the date:
<div>
<jhi-alert-error></jhi-alert-error>
...
<div class="table-responsive" *ngIf="myclasses?.length > 0">
<table class="table table-striped" aria-describedby="page-heading">
<thead>
<tr jhiSort [(predicate)]="predicate" [(ascending)]="reverse" [callback]="transition.bind(this)">
<th...
</tr>
</thead>
<tbody>
<tr *ngFor="let myclasse of myclasses ;trackBy: trackId">
<td>{{myclass?.id}}</td>
...
<td>
{{ new Date() }}
</td>
...