Mark
Mark

Reputation: 2587

Using Datejs - Get the day of the week

I'm using http://www.datejs.com/. I must be missing it, but is there a way I can pass it the day/month/year and have it tell me that it's a Friday or Monday or whatever?

Upvotes: 2

Views: 1603

Answers (2)

David Husselmann
David Husselmann

Reputation: 51

If you want to know whether it is a particular day of the week, you could do this:

Date.parse("1.16.2012").is().monday()

Upvotes: 0

Eve Freeman
Eve Freeman

Reputation: 33175

You want:

.toString("dddd");

For example:

> Date.parse("1.16.2012").toString("dddd");
"Monday"

Upvotes: 4

Related Questions