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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You want:
.toString("dddd");
For example:
> Date.parse("1.16.2012").toString("dddd");
"Monday"
回答2:
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()