Skip to content

Commit

Permalink
Corrects month off-by-one error
Browse files Browse the repository at this point in the history
  • Loading branch information
Dibasic committed Aug 29, 2018
1 parent a8c8a95 commit d813843
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pen.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ function processText(str) {
function getDateString() {
var date = new Date();
var yyyy = date.getFullYear() + 544;
var mm = date.getMonth() < 10 ? "0" + date.getMonth() : date.getMonth();
var mm = date.getMonth() + 1;
mm = mm < 10 ? "0" + mm : mm;
var dd = date.getDate();
return yyyy + "-" + mm + "-" + dd;
}
Expand Down

0 comments on commit d813843

Please sign in to comment.