ui.datepicker refactored for better 

As stated in the issue https://github.com/Elgg/Elgg/issues/7476, datepicker init function was refactored for better handling of loading locale settings. Also timestamp creation now uses datepicker.parseDate method as a less clumsy way of generating timestamp.