JS operation date by the way to implement the functions of the previous week and next week

Source: Internet
Author: User

Today, a working student asked me for help:
1. When a page is loaded, the current date is displayed in one place, and each of the left and right arrows indicates the last week and the next week respectively.
The following table shows each date of the week, from Monday to Sunday.
2. The left and right arrows show the day of the previous week or next week, and the following table shows each date of the previous week or next week.

JS itself does not provide the date addition and subtraction operation capability, so I wrote several methods to operate the date, mainly to add and subtract the date.
Author: Wen min, CTO of Chenzhou

JsDate.htm
<Body onload = "ini ()"> partition → <table id = "tb1" border = "1" style = "font-size: 10pt "> <tr> <td> </td> <td> </tr> </table>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.