@brinda_yawa/convertdate 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.
- package/.idea/convertDate.iml +8 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/README.md +6 -0
- package/package.json +14 -0
- package/src/index.js +12 -0
- package/test/index.js +5 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="inheritedJdk" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
</module>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/convertDate.iml" filepath="$PROJECT_DIR$/.idea/convertDate.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/README.md
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@brinda_yawa/convertdate",
|
|
3
|
+
"author":"@brinda_yawa",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"test": "jest"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["Date"],
|
|
12
|
+
"license": "ISC",
|
|
13
|
+
"description": "A test module to get the string representation of the date"
|
|
14
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
class ConvertDate{
|
|
2
|
+
constructor(){
|
|
3
|
+
}
|
|
4
|
+
convertDateIntoString(parsedDate){
|
|
5
|
+
parsedDate = new Date(parsedDate);
|
|
6
|
+
if (isNaN(parsedDate)) {
|
|
7
|
+
throw new Error("Invalid date");
|
|
8
|
+
}
|
|
9
|
+
return parsedDate.toLocaleString("en-US", { month: "long" });
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
export default new ConvertDate();
|