Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Javascript extensions that make handling dates with javascript suck less
JavaScript
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
README.rdoc
date.srewdriver.js

README.rdoc

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.

Something went wrong with that request. Please try again.