Travis build: 1300
This commit is contained in:
28
README.md
28
README.md
@ -252,6 +252,7 @@ _30s.average(1, 2, 3);
|
|||||||
* [`maxDate`](#maxdate)
|
* [`maxDate`](#maxdate)
|
||||||
* [`minDate`](#mindate)
|
* [`minDate`](#mindate)
|
||||||
* [`tomorrow`](#tomorrow)
|
* [`tomorrow`](#tomorrow)
|
||||||
|
* [`yesterday`](#yesterday)
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
@ -4579,6 +4580,32 @@ tomorrow(); // 2018-10-19 (if current date is 2018-10-18)
|
|||||||
|
|
||||||
<br>[⬆ Back to top](#contents)
|
<br>[⬆ Back to top](#contents)
|
||||||
|
|
||||||
|
### yesterday
|
||||||
|
|
||||||
|
Results in a string representation of yesterday's date.
|
||||||
|
|
||||||
|
Use `new Date()` to get the current date, decrement by one using `Date.getDate()` and set the value to the result using `Date.setDate()`.
|
||||||
|
Use `Date.prototype.toISOString()` to return a string in `yyyy-mm-dd` format.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const yesterday = () => {
|
||||||
|
let t = new Date();
|
||||||
|
t.setDate(t.getDate() - 1);
|
||||||
|
return t.toISOString().split('T')[0];
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Examples</summary>
|
||||||
|
|
||||||
|
```js
|
||||||
|
yesterday(); // 2018-10-17 (if current date is 2018-10-18)
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<br>[⬆ Back to top](#contents)
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -4736,6 +4763,7 @@ const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const lengthIs4 = checkProp(l => l === 4, 'length');
|
const lengthIs4 = checkProp(l => l === 4, 'length');
|
||||||
lengthIs4([]); // false
|
lengthIs4([]); // false
|
||||||
lengthIs4([1,2,3,4]); // true
|
lengthIs4([1,2,3,4]); // true
|
||||||
|
|||||||
@ -291,6 +291,7 @@
|
|||||||
<li><a tags="date,math,beginner" href="./date#maxdate">maxDate</a></li>
|
<li><a tags="date,math,beginner" href="./date#maxdate">maxDate</a></li>
|
||||||
<li><a tags="date,math,beginner" href="./date#mindate">minDate</a></li>
|
<li><a tags="date,math,beginner" href="./date#mindate">minDate</a></li>
|
||||||
<li><a tags="date,intermediate" href="./date#tomorrow">tomorrow</a></li>
|
<li><a tags="date,intermediate" href="./date#tomorrow">tomorrow</a></li>
|
||||||
|
<li><a tags="date,intermediate" href="./date#yesterday">yesterday</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4 class="collapse">Function
|
<h4 class="collapse">Function
|
||||||
</h4><ul><li><a tags="function,intermediate" href="./function#attempt">attempt</a></li>
|
</h4><ul><li><a tags="function,intermediate" href="./function#attempt">attempt</a></li>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -291,6 +291,7 @@
|
|||||||
<li><a tags="date,math,beginner" href="./date#maxdate">maxDate</a></li>
|
<li><a tags="date,math,beginner" href="./date#maxdate">maxDate</a></li>
|
||||||
<li><a tags="date,math,beginner" href="./date#mindate">minDate</a></li>
|
<li><a tags="date,math,beginner" href="./date#mindate">minDate</a></li>
|
||||||
<li><a tags="date,intermediate" href="./date#tomorrow">tomorrow</a></li>
|
<li><a tags="date,intermediate" href="./date#tomorrow">tomorrow</a></li>
|
||||||
|
<li><a tags="date,intermediate" href="./date#yesterday">yesterday</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<h4 class="collapse">Function
|
<h4 class="collapse">Function
|
||||||
</h4><ul><li><a tags="function,intermediate" href="./function#attempt">attempt</a></li>
|
</h4><ul><li><a tags="function,intermediate" href="./function#attempt">attempt</a></li>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -19,6 +19,7 @@ const checkProp = (predicate, prop) => obj => !!predicate(obj[prop]);
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const lengthIs4 = checkProp(l => l === 4, 'length');
|
const lengthIs4 = checkProp(l => l === 4, 'length');
|
||||||
lengthIs4([]); // false
|
lengthIs4([]); // false
|
||||||
lengthIs4([1,2,3,4]); // true
|
lengthIs4([1,2,3,4]); // true
|
||||||
|
|||||||
Reference in New Issue
Block a user