如何比较数组对象从今天开始的日期值?我搜索并尝试了很多方法,但仍未找到解决方案。
到目前为止,我已经完成了以下工作:
*ngIf="patientPrescriptions.appointments_patient_updated_at > now"
最佳答案
我找到了这个解决方案,它对我有用, 在你的 ts 文件中
const now = new Date;
today: string ;
this.today =now.toISOString();
在你的 html 文件中,
*ngIf= "model.LeaveFrom > today"
如果模型日期大于今天,它会为您提供日期。
关于angular - 如何比较模板Angular 4中的日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47566560/