Skip to content

Commit

Permalink
-5 bytes :D
Browse files Browse the repository at this point in the history
  • Loading branch information
10Nates committed Apr 1, 2022
1 parent 6f21963 commit bf3a5e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

### What is MicroCookie?

MicroCookie is a desert-bone-dry cookie management package (just 654 bytes minimized!) designed to be so small you don't even notice it's there. It's also [100% compatible.](https://seedmanc.github.io/jscc/)
MicroCookie is a desert-bone-dry cookie management package (just 649 bytes minimized!) designed to be so small you don't even notice it's there. It's also [100% compatible.](https://seedmanc.github.io/jscc/)

<br>

Expand Down
4 changes: 2 additions & 2 deletions export/microcookie-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions microcookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ var MicroCookie = {
*/
makeExpiration: function (d, w, m, y) {
//milliseconds -> seconds, not using Date.now() for compatibility
var nowsecs = Math.floor(new Date().getTime() / 1000)
// secs in a day secs in a week secs in 30.4375 days secs in 365.25 days
var newtime = nowsecs + (d ? d * 86400 : 0) + (w ? w * 604800 : 0) + (m ? m * 2629800 : 0) + (y ? y * 31557600 : 0)
// current seconds secs in a day secs in a week secs in 30.4375 days secs in 365.25 days
var newtime = Math.floor(new Date().getTime() / 1000) + (d ? d * 86400 : 0) + (w ? w * 604800 : 0) + (m ? m * 2629800 : 0) + (y ? y * 31557600 : 0)
return Math.floor(newtime)
}

Expand Down

0 comments on commit bf3a5e8

Please sign in to comment.