@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.
@@ -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,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Ask2AgentMigrationStateService">
4
+ <option name="migrationStatus" value="COMPLETED" />
5
+ </component>
6
+ </project>
@@ -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
@@ -0,0 +1,6 @@
1
+ ## Installation
2
+
3
+ npm install @brinda_yawa/convertdate
4
+
5
+ ## Usage
6
+
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();
package/test/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import convertDate from "../src/index.js";
2
+
3
+ console.log(convertDate.convertDateIntoString("2001-06-15"));
4
+
5
+