update snippets 0-All
This commit is contained in:
committed by
Agamemnon Zorbas
parent
39164e9cbf
commit
e7e687f60c
@ -7,5 +7,8 @@ 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) {} };
|
||||
// toEnglishDate('09/21/2010') -> '21/09/2010'
|
||||
```
|
||||
|
||||
```js
|
||||
toEnglishDate('09/21/2010') // '21/09/2010'
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user