some rearrangement
rearranged js, added gem to deal with american dates, datetime should all work