This repository has been archived by the owner. It is now read-only.
Javascript extensions that make handling dates with javascript suck less
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
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.