Skip to content

Commit

Permalink
修复倒计时计算问题|打包1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Littleor committed Jul 30, 2020
1 parent 768fe43 commit f5ad669
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion MainWidget/Widget/CountDown.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ extension Date {
let nowTimeStamp = Int(now.timeIntervalSince1970)
let toDateTimeStamp = Int(toDate.timeIntervalSince1970)
let difference:Double = Double(abs(nowTimeStamp - toDateTimeStamp))
return Int(floor( difference / (86400))) + 1
if(nowTimeStamp < toDateTimeStamp){
return Int(floor( difference / (86400))) + 1
}
else{
return Int(floor( difference / (86400)))
}

}
func dateToString(_ date:Date,dateFormat:String = "yyyy-MM-dd HH:mm:ss") -> String {
let formatter = DateFormatter()
Expand Down
Binary file added Release/iWidget 1.0.ipa
Binary file not shown.

0 comments on commit f5ad669

Please sign in to comment.