Fix date calculation logic

I wanted to use filenames like `_posts/YYYY/MM-DD-title.md`, but it did not work fine.

I don't know this fix is correct or not, but it seems fine to me.