Travis build: 1171
This commit is contained in:
32
README.md
32
README.md
@ -178,7 +178,6 @@ average(1, 2, 3);
|
||||
|
||||
* [`formatDuration`](#formatduration)
|
||||
* [`getDaysDiffBetweenDates`](#getdaysdiffbetweendates)
|
||||
* [`toEnglishDate`](#toenglishdate)
|
||||
* [`tomorrow`](#tomorrow)
|
||||
|
||||
</details>
|
||||
@ -2547,36 +2546,6 @@ getDaysDiffBetweenDates(new Date('2017-12-13'), new Date('2017-12-22')); // 9
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### 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) {}
|
||||
};
|
||||
```
|
||||
|
||||
<details>
|
||||
<summary>Examples</summary>
|
||||
|
||||
```js
|
||||
toEnglishDate('09/21/2010'); // '21/09/2010'
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<br>[⬆ Back to top](#table-of-contents)
|
||||
|
||||
|
||||
### tomorrow
|
||||
|
||||
Results in a string representation of tomorrow's date.
|
||||
@ -5209,6 +5178,7 @@ const httpPost = (url, callback, data = null, err = console.error) => {
|
||||
|
||||
|
||||
|
||||
|
||||
const newPost = {
|
||||
"userId": 1,
|
||||
"id": 1337,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -25,6 +25,7 @@ const httpPost = (url, callback, data = null, err = console.error) => {
|
||||
|
||||
|
||||
|
||||
|
||||
const newPost = {
|
||||
"userId": 1,
|
||||
"id": 1337,
|
||||
|
||||
@ -165,7 +165,6 @@ takeRight:array
|
||||
timeTaken:utility
|
||||
toCamelCase:string,regexp
|
||||
toDecimalMark:utility,math
|
||||
toEnglishDate:date,string
|
||||
toggleClass:browser
|
||||
toKebabCase:string,regexp
|
||||
tomorrow:date
|
||||
|
||||
Reference in New Issue
Block a user