Using Datejs - Get the day of the week

痞子三分冷 提交于 2019-12-11 02:49:20

问题


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()



来源:https://stackoverflow.com/questions/8889339/using-datejs-get-the-day-of-the-week

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!