คำนวนวันที่ทำงาน
This commit is contained in:
parent
428670b515
commit
87068a9926
2 changed files with 3 additions and 3 deletions
|
|
@ -510,12 +510,12 @@ const fetchData = async () => {
|
|||
monthDiff = monthDiff + d.monthDiff
|
||||
dayDiff = dayDiff + d.dayDiff
|
||||
if (dayDiff > 30) {
|
||||
dayDiff = dayDiff % 30
|
||||
monthDiff = monthDiff + parseInt((dayDiff / 30).toString())
|
||||
dayDiff = dayDiff % 30
|
||||
}
|
||||
if (monthDiff > 12) {
|
||||
monthDiff = monthDiff % 12
|
||||
yearDiff = yearDiff + parseInt((monthDiff / 12).toString())
|
||||
monthDiff = monthDiff % 12
|
||||
}
|
||||
total.value = `${yearDiff > 0 ? yearDiff + ' ปี ' : ''}${
|
||||
monthDiff > 0 ? monthDiff + ' เดือน ' : ''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue