Skip to content
This repository has been archived by the owner on Dec 10, 2017. It is now read-only.

Javascript extensions that make handling dates with javascript suck less

Notifications You must be signed in to change notification settings

agileapplications/date-screwdriver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

date-screwdriver

I needed an independent javascript library for date calculations. It also should feel nice to work with, thats why it is similar to the Rails Date Extension.

Usage

Everything is done at instance level, so let’s create a date instance:

var date = new Date();

Convenience getters as entree:

date.isMonday();   
date.isThuesday(); 
date.isWednesday();
date.isThursday(); 
date.isFriday();   
date.isSaturday(); 
date.isSunday();

Convenience setters as main dish:

date.lastDay();        
date.nextDay();        
date.yesterday();      
date.tomorrow();       
date.beginningOfWeek();
date.endOfWeek();

And some sweets for dessert:

date.toStringDBDate();                 // "2010-02-23"
date.toStringDayNumber();              // 9, 22, ...
date.toStringDayNumberFixed();         // "09", "22", ...
date.toStringDayName();                // "Montag"
date.toStringDayAbbreviation();        // "Mo"

More to come…

I will add more to the menu on request.

About

Javascript extensions that make handling dates with javascript suck less

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published