SlideShare uma empresa Scribd logo
1 de 10
XDate

A Modern JavaScript Date Library

          Albert Guo
          2012/12/06
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.


                                                  2
Where to download
   • http://arshaw.com/xdate




                               3
Requirements
   • 1. Straightforward to get current date and
     format it
   • 2. Easy to do add days and get expected
     result




                                                  4
Prerequisite
   • Import xdate.js in <head></head>




                                        5
Straightforward to get current
date and format it
     Creates a new XDate
      with the current date
            and time




       Call toString to do
           formatting


                                 6
Straightforward to get current
              date and format it – cont.



html




JS function




                                               7
Easy to do add days and get
expected result
     Creates a new XDate
      with the current date
            and time




      Call adding method



                              8
Easy to do add days and get
expected result – cont.



                   2012/12/6 + 30 days




                                         9
Easy to do add days and get
              expected result – cont.
HTML




JS function




                                            10

Mais conteúdo relacionado

Semelhante a XDate - a modern java-script date library

Subhajit_Dey_7yr_exp_Resume
Subhajit_Dey_7yr_exp_ResumeSubhajit_Dey_7yr_exp_Resume
Subhajit_Dey_7yr_exp_ResumeSubhajit Dey
 
Using WordPress for leading local newspaper websites
Using WordPress for leading local newspaper websitesUsing WordPress for leading local newspaper websites
Using WordPress for leading local newspaper websitesChristoph Daum
 
Database Development: The Object-oriented and Test-driven Way
Database Development: The Object-oriented and Test-driven WayDatabase Development: The Object-oriented and Test-driven Way
Database Development: The Object-oriented and Test-driven WayTechWell
 
Resume - Joydeep Lodh -Updated
Resume - Joydeep Lodh -UpdatedResume - Joydeep Lodh -Updated
Resume - Joydeep Lodh -UpdatedJoydeep Lodh
 
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...Dart Past Your Competition by Getting Your Digital Experience into Market Fas...
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...Perficient, Inc.
 
AshishKumarResume2_MVC
AshishKumarResume2_MVCAshishKumarResume2_MVC
AshishKumarResume2_MVCAshish Dwivedi
 
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021:  Managing Digital Transformation on a Budget by Bert ScalzoIdera live 2021:  Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021: Managing Digital Transformation on a Budget by Bert ScalzoIDERA Software
 
The Perils and Triumphs of using Cassandra at a .NET/Microsoft Shop
The Perils and Triumphs of using Cassandra at a .NET/Microsoft ShopThe Perils and Triumphs of using Cassandra at a .NET/Microsoft Shop
The Perils and Triumphs of using Cassandra at a .NET/Microsoft ShopJeff Smoley
 
Incremental DOM and Recent Trend of Frontend Development
Incremental DOM and Recent Trend of Frontend DevelopmentIncremental DOM and Recent Trend of Frontend Development
Incremental DOM and Recent Trend of Frontend DevelopmentAkihiro Ikezoe
 
David Zins - resume 2016
David Zins - resume 2016David Zins - resume 2016
David Zins - resume 2016David Zins
 
Deploying a Modern Data Stack by Lasse Benninga - GoDataFest 2022
Deploying a Modern Data Stack by Lasse Benninga - GoDataFest 2022Deploying a Modern Data Stack by Lasse Benninga - GoDataFest 2022
Deploying a Modern Data Stack by Lasse Benninga - GoDataFest 2022GoDataDriven
 
Anatomy of a Progressive Web App
Anatomy of a Progressive Web AppAnatomy of a Progressive Web App
Anatomy of a Progressive Web AppMike North
 
Hemanth Kumar - Drupal Architect
Hemanth Kumar - Drupal ArchitectHemanth Kumar - Drupal Architect
Hemanth Kumar - Drupal ArchitectHemanth Kumar
 
Intentionally dealing with responsive design
Intentionally dealing with responsive designIntentionally dealing with responsive design
Intentionally dealing with responsive designeveryplace
 
What's New in Bedework 3.8
What's New in Bedework 3.8What's New in Bedework 3.8
What's New in Bedework 3.8bleibson
 
How to Use Innovative Data Handling and Processing Techniques to Drive Alpha ...
How to Use Innovative Data Handling and Processing Techniques to Drive Alpha ...How to Use Innovative Data Handling and Processing Techniques to Drive Alpha ...
How to Use Innovative Data Handling and Processing Techniques to Drive Alpha ...DataWorks Summit
 

Semelhante a XDate - a modern java-script date library (20)

Subhajit_Dey_7yr_exp_Resume
Subhajit_Dey_7yr_exp_ResumeSubhajit_Dey_7yr_exp_Resume
Subhajit_Dey_7yr_exp_Resume
 
Using WordPress for leading local newspaper websites
Using WordPress for leading local newspaper websitesUsing WordPress for leading local newspaper websites
Using WordPress for leading local newspaper websites
 
TUG 2009 Roadmap
TUG 2009 RoadmapTUG 2009 Roadmap
TUG 2009 Roadmap
 
Database Development: The Object-oriented and Test-driven Way
Database Development: The Object-oriented and Test-driven WayDatabase Development: The Object-oriented and Test-driven Way
Database Development: The Object-oriented and Test-driven Way
 
Resume - Joydeep Lodh -Updated
Resume - Joydeep Lodh -UpdatedResume - Joydeep Lodh -Updated
Resume - Joydeep Lodh -Updated
 
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...Dart Past Your Competition by Getting Your Digital Experience into Market Fas...
Dart Past Your Competition by Getting Your Digital Experience into Market Fas...
 
AshishKumarResume2_MVC
AshishKumarResume2_MVCAshishKumarResume2_MVC
AshishKumarResume2_MVC
 
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021:  Managing Digital Transformation on a Budget by Bert ScalzoIdera live 2021:  Managing Digital Transformation on a Budget by Bert Scalzo
Idera live 2021: Managing Digital Transformation on a Budget by Bert Scalzo
 
(20.05.2009) Cumuy Presenta - Más tecnologías interesantes para conocer - PPT 2
(20.05.2009) Cumuy Presenta - Más tecnologías interesantes para conocer - PPT 2(20.05.2009) Cumuy Presenta - Más tecnologías interesantes para conocer - PPT 2
(20.05.2009) Cumuy Presenta - Más tecnologías interesantes para conocer - PPT 2
 
The Perils and Triumphs of using Cassandra at a .NET/Microsoft Shop
The Perils and Triumphs of using Cassandra at a .NET/Microsoft ShopThe Perils and Triumphs of using Cassandra at a .NET/Microsoft Shop
The Perils and Triumphs of using Cassandra at a .NET/Microsoft Shop
 
Incremental DOM and Recent Trend of Frontend Development
Incremental DOM and Recent Trend of Frontend DevelopmentIncremental DOM and Recent Trend of Frontend Development
Incremental DOM and Recent Trend of Frontend Development
 
David Zins - resume 2016
David Zins - resume 2016David Zins - resume 2016
David Zins - resume 2016
 
Deploying a Modern Data Stack by Lasse Benninga - GoDataFest 2022
Deploying a Modern Data Stack by Lasse Benninga - GoDataFest 2022Deploying a Modern Data Stack by Lasse Benninga - GoDataFest 2022
Deploying a Modern Data Stack by Lasse Benninga - GoDataFest 2022
 
MYDATA
MYDATAMYDATA
MYDATA
 
Anatomy of a Progressive Web App
Anatomy of a Progressive Web AppAnatomy of a Progressive Web App
Anatomy of a Progressive Web App
 
React & redux
React & reduxReact & redux
React & redux
 
Hemanth Kumar - Drupal Architect
Hemanth Kumar - Drupal ArchitectHemanth Kumar - Drupal Architect
Hemanth Kumar - Drupal Architect
 
Intentionally dealing with responsive design
Intentionally dealing with responsive designIntentionally dealing with responsive design
Intentionally dealing with responsive design
 
What's New in Bedework 3.8
What's New in Bedework 3.8What's New in Bedework 3.8
What's New in Bedework 3.8
 
How to Use Innovative Data Handling and Processing Techniques to Drive Alpha ...
How to Use Innovative Data Handling and Processing Techniques to Drive Alpha ...How to Use Innovative Data Handling and Processing Techniques to Drive Alpha ...
How to Use Innovative Data Handling and Processing Techniques to Drive Alpha ...
 

Mais de Guo Albert

AWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorAWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorGuo Albert
 
TOEIC 準備心得
TOEIC 準備心得TOEIC 準備心得
TOEIC 準備心得Guo Albert
 
DBM專案環境建置
DBM專案環境建置DBM專案環境建置
DBM專案環境建置Guo Albert
 
JPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionJPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionGuo Albert
 
How to avoid check style errors
How to avoid check style errorsHow to avoid check style errors
How to avoid check style errorsGuo Albert
 
NIG系統報表開發指南
NIG系統報表開發指南NIG系統報表開發指南
NIG系統報表開發指南Guo Albert
 
Ease Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableEase Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableGuo Albert
 
NIG 系統開發指引
NIG 系統開發指引NIG 系統開發指引
NIG 系統開發指引Guo Albert
 
NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟Guo Albert
 
Form Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemForm Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemGuo Albert
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReportsGuo Albert
 
Apply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationApply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationGuo Albert
 
Utilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectUtilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectGuo Albert
 
Apply my eclipse to do entity class generation
Apply my eclipse to do entity class generationApply my eclipse to do entity class generation
Apply my eclipse to do entity class generationGuo Albert
 
Nig project setup quickly tutorial
Nig project setup quickly tutorialNig project setup quickly tutorial
Nig project setup quickly tutorialGuo Albert
 
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplateGuo Albert
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkGuo Albert
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvcGuo Albert
 
Spring db-access mod03
Spring db-access mod03Spring db-access mod03
Spring db-access mod03Guo Albert
 

Mais de Guo Albert (20)

AWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy SimulatorAWS IAM (Identity and Access Management) Policy Simulator
AWS IAM (Identity and Access Management) Policy Simulator
 
TOEIC 準備心得
TOEIC 準備心得TOEIC 準備心得
TOEIC 準備心得
 
DBM專案環境建置
DBM專案環境建置DBM專案環境建置
DBM專案環境建置
 
JPA Optimistic Locking With @Version
JPA Optimistic Locking With @VersionJPA Optimistic Locking With @Version
JPA Optimistic Locking With @Version
 
How to avoid check style errors
How to avoid check style errorsHow to avoid check style errors
How to avoid check style errors
 
NIG系統報表開發指南
NIG系統報表開發指南NIG系統報表開發指南
NIG系統報表開發指南
 
Ease Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History TableEase Your Effort of Putting Data into History Table
Ease Your Effort of Putting Data into History Table
 
NIG 系統開發指引
NIG 系統開發指引NIG 系統開發指引
NIG 系統開發指引
 
NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟NIG系統開發文件閱讀步驟
NIG系統開發文件閱讀步驟
 
Form Bean Creation Process for NIG System
Form Bean Creation Process for NIG SystemForm Bean Creation Process for NIG System
Form Bean Creation Process for NIG System
 
A Short Intorduction to JasperReports
A Short Intorduction to JasperReportsA Short Intorduction to JasperReports
A Short Intorduction to JasperReports
 
Apply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report ImplementationApply Template Method Pattern in Report Implementation
Apply Template Method Pattern in Report Implementation
 
Utilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy objectUtilize Commons BeansUtils to do copy object
Utilize Commons BeansUtils to do copy object
 
Apply my eclipse to do entity class generation
Apply my eclipse to do entity class generationApply my eclipse to do entity class generation
Apply my eclipse to do entity class generation
 
Nig project setup quickly tutorial
Nig project setup quickly tutorialNig project setup quickly tutorial
Nig project setup quickly tutorial
 
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplate
 
Java Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC FrameworkJava Server Faces + Spring MVC Framework
Java Server Faces + Spring MVC Framework
 
Toms introtospring mvc
Toms introtospring mvcToms introtospring mvc
Toms introtospring mvc
 
Spring db-access mod03
Spring db-access mod03Spring db-access mod03
Spring db-access mod03
 
Spring mvc
Spring mvcSpring mvc
Spring mvc
 

XDate - a modern java-script date library

  • 1. 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. 2
  • 3. Where to download • http://arshaw.com/xdate 3
  • 4. Requirements • 1. Straightforward to get current date and format it • 2. Easy to do add days and get expected result 4
  • 5. Prerequisite • Import xdate.js in <head></head> 5
  • 6. Straightforward to get current date and format it Creates a new XDate with the current date and time Call toString to do formatting 6
  • 7. Straightforward to get current date and format it – cont. html JS function 7
  • 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 9
  • 10. Easy to do add days and get expected result – cont. HTML JS function 10