แก้ไข return null เมื่อวันที่ไม่สอดคล้อง
This commit is contained in:
parent
71cbecdce0
commit
9b85f0d021
1 changed files with 1 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
export function calculateAge(start: Date, end = new Date()) {
|
||||
if (start.getTime() > end.getTime()) return;
|
||||
if (start.getTime() > end.getTime()) return null;
|
||||
|
||||
let year = end.getFullYear() - start.getFullYear();
|
||||
let month = end.getMonth() - start.getMonth();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue