Update post date when publishing for first time

I previously opened a pull request and after getting feedback, updated the code. However, I also just found about the contributing guidelines so have followed those and reforked and PRed.

Anyway, this has fixed #635 where the post date doesn't update automatically. It only updates when it has previously been a draft and is now published - presumably for the first time.