This commit is contained in:
Angelos Chalaris
2017-12-27 11:02:46 +02:00
parent 37bb271221
commit 3d79413392
45 changed files with 89 additions and 91 deletions

View File

@ -6,7 +6,6 @@ Use `Date.toISOString()`, `split('T')` and `replace()` to convert a date from Am
Throws an error if the passed time cannot be converted to a date.
```js
const toEnglishDate = (time) =>
{try{return new Date(time).toISOString().split('T')[0].replace(/-/g, '/')}catch(e){return}};
const toEnglishDate = (time) => { try { return new Date(time).toISOString().split('T')[0].replace(/-/g, '/'); } catch (e) {} };
// toEnglishDate('09/21/2010') -> '21/09/2010'
```