Save date when changing state