ui.datepicker refactored for better handling of locale settings

As stated in the issue https://github.com/Elgg/Elgg/issues/7476. Also timestamp creation now uses datepicker.parseDate method as a less clumsy way of generating timestamp. 
Instead of a switch statement, use a map for the ones that are different:

```js
var localeMap = {
  'pt_br': 'pt-BR',
  'cmn': 'zh-CN',
};

url += 'jquery.ui.datepicker-' + localeMap[locale] || locale + '.js';
```