Fixes format changes in javascript to allow for saving in database.