-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.js
49 lines (46 loc) · 893 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* week-seconds <https://github.com/datetime/week-seconds>
*
* Copyright (c) 2014-2015 Charlike Mike Reagent, contributors.
* Released under the MIT license.
*/
'use strict';
var daySeconds = require('day-seconds');
/**
* Get the number of hours in a week.
*
* **Example:**
*
* ```js
* var weekSeconds = require('week-seconds');
*
* weekSeconds(false);
* //=> 604800000
*
* weekSeconds();
* //=> 604800000
*
* weekSeconds('str');
* //=> 604800000
*
* weekSeconds([1,2,3]);
* //=> 604800000
*
* weekSeconds(/regex/gm);
* //=> 604800000
*
* weekSeconds({});
* //=> 604800000
*
* weekSeconds(true);
* //=> 604800
* ```
*
* @name weekSeconds
* @param {Boolean} `[bool]` when `true`, returns seconds, pass to [day-seconds][day-seconds]
* @return {Number}
* @api public
*/
module.exports = function weekSeconds(bool) {
return 7 * daySeconds(bool);
};