@garevalo1994/giodateformate 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.MD +9 -0
  2. package/package.json +13 -0
  3. package/src/index.js +22 -0
package/README.MD ADDED
@@ -0,0 +1,9 @@
1
+ # PlatziDate
2
+
3
+ Una utilidad para manejar fechas en formato timestamp y long time.
4
+
5
+ # Install
6
+
7
+ ```bash
8
+ npm install platzidate
9
+ ```
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@garevalo1994/giodateformate",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "main": "src/index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": ["date","nodejs"],
10
+ "author": "Giovanni Arevalo",
11
+ "license": "MIT",
12
+ "type": "commonjs"
13
+ }
package/src/index.js ADDED
@@ -0,0 +1,22 @@
1
+ function getTimeStamp(){
2
+ return Date.now();
3
+ }
4
+
5
+ function getLongTime(locale = "es-ES"){
6
+ const options={
7
+ weekday: 'long',
8
+ year: 'numeric',
9
+ month: 'long',
10
+ day: 'numeric',
11
+ hour: 'numeric',
12
+ minute: 'numeric',
13
+ second: 'numeric',
14
+ timeZoneName: 'short'
15
+ };
16
+ return new Date().toLocaleString(locale,options);
17
+ }
18
+
19
+ module.exports = {
20
+ getTimeStamp,
21
+ getLongTime
22
+ }