Javascript sucks. making it to format date as yyyy-mm-dd is such a pain.