Permalink
Browse files

Added link to live demo.

  • Loading branch information...
1 parent 43bd6b8 commit 1d5551be7c7ae26b3eab43565f2c2e4146b53049 @kensnyder committed Oct 5, 2011
Showing with 13 additions and 11 deletions.
  1. +13 −11 README.markdown
View
@@ -1,18 +1,20 @@
+Live demo and documentation at [http://sandbox.kendsnyder.com/date/](http://sandbox.kendsnyder.com/date/)
+
This script provides JavaScript Date instance methods for parsing, formatting, and calculating dates. It leverages the existing functionality of the native Date.parse method and uses a concise and configurable algorithm for interpreting format codes.
Features include:
- * Parse various formats with ability to register custom format parsing.
- * Format dates using the well-known percent-letter formatting options with the ability to register custom formating.
- * Add and subtract years, months, days, hours, minutes or seconds.
- * Calculate differences between dates in the given unit.
- * Methods are available on all Date Objects.
+ * Parse various formats with ability to register custom format parsing.
+ * Format dates using the well-known percent-letter formatting options with the ability to register custom formating.
+ * Add and subtract years, months, days, hours, minutes or seconds.
+ * Calculate differences between dates in the given unit.
+ * Methods are available on all Date Objects.
Examples:
- * $D('2006-09-20').strftime('%m/%d/%Y'); // "09/20/2006"
- * $D('Sep 20 2006').add(3).strftime('%Y-%m-%d'); // "2006-09-23"
- * $D('09/20/2006').add(4, 'years').strftime('%Y-%m-%d'); // "2010-09-20"
- * $D('09/20/2006 20:15:00').add(4, 'hours').format('%Y-%m-%d %H:%M:%S'); // "2006-09-21 00:15:00"
- * $D('2006-09-20').format('m/d/Y'); // "09/20/2006"
- * $D('2006.09.28').diff('20 Sep, 2006', 'days'); // 8
+ * $D('2006-09-20').strftime('%m/%d/%Y'); // "09/20/2006"
+ * $D('Sep 20 2006').add(3).strftime('%Y-%m-%d'); // "2006-09-23"
+ * $D('09/20/2006').add(4, 'years').strftime('%Y-%m-%d'); // "2010-09-20"
+ * $D('09/20/2006 20:15:00').add(4, 'hours').format('%Y-%m-%d %H:%M:%S'); // "2006-09-21 00:15:00"
+ * $D('2006-09-20').format('m/d/Y'); // "09/20/2006"
+ * $D('2006.09.28').diff('20 Sep, 2006', 'days'); // 8
See reference.html for demo and complete guide

0 comments on commit 1d5551b

Please sign in to comment.