remove toEnglishDate

This commit is contained in:
Stefan Feješ
2018-01-11 10:14:13 +01:00
parent 9b57ac1bc3
commit a79ea2f1f5

View File

@ -1,21 +0,0 @@
### toEnglishDate
Converts a date from American format to English format.
Use `Date.toISOString()`, `split('T')` and `replace()` to convert a date from American format to the English format.
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) {}
};
```
```js
toEnglishDate('09/21/2010'); // '21/09/2010'
```