Replacing the old date api by the momentjs API

Hi there!

I have replaced almost all the calls to the old date API by the new API.

= )