[nodejs-isodate] Initial import

Jamie Nguyen jamielinux at fedoraproject.org
Tue Jun 18 05:28:17 UTC 2013


commit e4e9e767a25667ef225bb51a7b78f50b93f5c19f
Author: Jamie Nguyen <j at jamielinux.com>
Date:   Tue Jun 18 06:27:58 2013 +0100

    Initial import

 .gitignore          |    1 +
 nodejs-isodate.spec |   56 +++++++++++++++++++++++++++++++++++++++++++++++++++
 sources             |    1 +
 test.js             |   20 ++++++++++++++++++
 4 files changed, 78 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..e49b7c5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/isodate-0.1.4.tgz
diff --git a/nodejs-isodate.spec b/nodejs-isodate.spec
new file mode 100644
index 0000000..6b3a85b
--- /dev/null
+++ b/nodejs-isodate.spec
@@ -0,0 +1,56 @@
+%{?nodejs_find_provides_and_requires}
+
+%global enable_tests 1
+
+Name:       nodejs-isodate
+Version:    0.1.4
+Release:    2%{?dist}
+Summary:    JavaScript ISO 8601 date/time parser for Node.js
+License:    MIT
+Group:      System Environment/Libraries
+URL:        https://github.com/pvorb/node-isodate
+Source0:    http://registry.npmjs.org/isodate/-/isodate-%{version}.tgz
+# One test file is not included in the npm tarball.
+Source1:    https://raw.github.com/pvorb/node-isodate/4864e664cabba43003424453a82d50fd8f133737/test.js
+BuildArch:  noarch
+
+BuildRequires:  nodejs-devel
+
+%description
+%{summary}.
+
+
+%prep
+%setup -q -n package
+cp -a %{SOURCE1} .
+
+
+%build
+#nothing to do
+
+
+%install
+mkdir -p %{buildroot}%{nodejs_sitelib}/isodate
+cp -pr package.json isodate.js \
+    %{buildroot}%{nodejs_sitelib}/isodate
+
+%nodejs_symlink_deps
+
+
+%if 0%{?enable_tests}
+%check
+%__nodejs test.js
+%endif
+
+
+%files
+%doc LICENSE README.md
+%{nodejs_sitelib}/isodate
+
+
+%changelog
+* Sun Jun 16 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.1.4-2
+- include test.js
+
+* Wed Feb 13 2013 Jamie Nguyen <jamielinux at fedoraproject.org> - 0.1.4-1
+- initial package
diff --git a/sources b/sources
index e69de29..abacebd 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+a0200a3bf4624d8da666a34b37d4a9e8  isodate-0.1.4.tgz
diff --git a/test.js b/test.js
new file mode 100644
index 0000000..9ceb678
--- /dev/null
+++ b/test.js
@@ -0,0 +1,20 @@
+var ISODate = require("./");
+
+// Parse ISO date string
+var datestring = "2011-08-18T19:03:37+01:00";
+console.log("Parsing: " + datestring);
+console.log("Result: " + ISODate(datestring) + "\n");
+
+// Parse ISO date string without delimiters
+datestring = "20110818T190337+0100";
+console.log("Parsing: " + datestring);
+console.log("Result: " + ISODate(datestring) + "\n");
+
+datestring = "2011-04-16T00:00:00Z";
+console.log("Parsing: " + datestring);
+console.log("Result: " + ISODate(datestring) + "\n");
+
+// Writing current time
+console.log("Parsing current time.");
+var date = new Date();
+console.log(date.toISOString());


More information about the scm-commits mailing list