Permalink
Browse files

Fixed stupid zero doesn't mean false bug

  • Loading branch information...
1 parent 912a837 commit 58011633a426489693699680aac025a82fd870d4 @laktek committed Jan 5, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 lib/blog_content_handler.js
  2. +1 −1 spec/blog_content_handler.spec.js
@@ -381,7 +381,7 @@ module.exports = {
var month = parseInt(slugs[mappings["month"]], 10) - 1;
var date = parseInt(slugs[mappings["date"]], 10);
- if (year && month && date) {
+ if (( year && month && date ) > -1) {
return new Date(year, month, date);
} else {
return ctime;
@@ -604,7 +604,7 @@ describe("parse content", function() {
permalink: "/2012/11/18/test-post", last_modified: new Date(2012, 10, 20) });
});
- it("set the permalink in user defined format", function() {
+ it("set the permalink in user defined format (and published date based on the last modified)", function() {
var sample_config = {
post_url: "/{year}/{date}-{title}",
}

0 comments on commit 5801163

Please sign in to comment.