SoFunction
Updated on 2025-04-03

Recommend a small JS calendar

The core of the script is the DateAdd function. Click the following demonstration to see the effect:
View the demo

The calling method is very simple.
Step 1: Include the file at the top of the page:
<script src="path/to/"></script>
Click to download this js file

Step 2: Add onfocus event attribute to your input box:
<input type="text" onfocus="HS_setDate(this)">
HS_setDate(this) is an initialized function

This calendar has been applied to the sidebar of this blog, and ajax function has been added to asynchronously query the days with logs and bold them.


[Ctrl+A Select all Note:Introducing external Js requires refreshing the page before execution]