adding to_s to the JS to get it to work for dates