Update post date if published for the first time

Sorry that I've had to create and close a couple of pull requests, I'm still learning.

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.