iamkun/dayjs

dayjs.duration(x.diff(y)) 后获取seconds()返回大于59 #865

Syntax-J posted onGitHub

Describe the bug

let a = dayjs()
let b = dayjs().add(61, 's')
let c = dayjs.duration(b.diff(a))
console.log(c.minutes(), c.seconds())

image image

moment表现正常 image

Expected behavior 返回0到59 Information

  • Day.js Version [1.8.24]
  • OS: [Catalina]
  • Browser [chrome 81]

@iamkun has funded $1.00 to this issue.


posted by issuehunt-app[bot] almost 5 years ago

@iamkun has cancelled funding for this issue.(Cancelled amount: $1.00) See it on IssueHunt

posted by issuehunt-app[bot] almost 5 years ago

dayjs v1.8.24 minutes() same problem

const time = dayjs.duration(12345, 's');
console.log(time.hours(), time.minutes(), time.seconds());
// 3 205 12345
posted by CatsMiaow almost 5 years ago
posted by iamkun almost 5 years ago

:tada: This issue has been resolved in version 1.8.25 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

posted by iamkun almost 5 years ago

Fund this Issue

$0.00
Funded

Pull requests

Recent activities

iamkun cancelled funding 1.00 for  iamkun/ dayjs#865
almost 5 years ago
iamkun withdrew the output  to  iamkun/ dayjs# 865
almost 5 years ago