从提供的日期获取一周的第一个日期 [英] Get first date of week from provided date

查看:118
本文介绍了从提供的日期获取一周的第一个日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一个日期对象传递给一个函数,并确定该周的第一个日期是什么。

I want to pass a date object into a function and determine what the first date of that week was.

示例:如果我在今天的日期(2009 / 06/24)我希望该函数返回本周的第一个日期,即星期日的日期是2009/06/21,所以它必须返回。

Example: If I pass in today's date (2009/06/24) I want the function to return what the first date of this week was, i.e. Sunday's date was 2009/06/21 so it must return that.

任何人知道任何标准的javascript功能吗?谢谢

Anyone know of any standard javascript function that does that? Thanks

推荐答案

找到这个问题的答案:如何从上一周的第一天获得日期对象在JavaScript?

found the answer on this question: How do I get the first day of the previous week from a date object in JavaScript?

这篇关于从提供的日期获取一周的第一个日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆