xdate - a modern java-script date library
DESCRIPTION
XDate is a thin wrapper around JavaScript's native Date object that provides enhanced functionality for parsing, formatting, and manipulating datesTRANSCRIPT
XDate
A Modern JavaScript Date Library
Albert Guo
2012/12/06
2
Introduction• XDate is a thin wrapper around
JavaScript's native Date object that provides enhanced functionality for parsing, formatting, and manipulating dates. It implements the same methods as the native Date, so it should seem very familiar.
• Also, it is non-destructive to the DOM, so it can safely be included in third party libraries without fear of side effects.
4
Requirements• 1. Straightforward to get current date and
format it • 2. Easy to do add days and get expected
result
5
Prerequisite• Import xdate.js in <head></head>
6
Straightforward to get current date and format it
Creates a new XDate with the
current date and time
Call toString to do formatting
7
Straightforward to get current date and format it – cont.
html
JS function
8
Easy to do add days and get expected result
Creates a new XDate with the
current date and time
Call adding method
8
9
Easy to do add days and get expected result – cont.
2012/12/6 + 30 days
10
Easy to do add days and get expected result – cont.
HTML
JS function