Reputation: 506
Okay, so I have a website I am creating, and I have a calendar made with HTML.
I want to add raquo's to the left and right of where it says (January 2013), so the user can browse the future and past months. How can I achieve this, along with making it update every month? Anyone have any ideas? It's coded in pure xHTML and CSS.
Long story short: How can I make this update the calendar monthly automatically? Also, how can I browse future and past months? (jQuery maybe?)
Thanks a lot, IntactDev
Upvotes: 0
Views: 3813
Reputation: 302
Have you looked at AJAX/jQuery? It has functionality for a date-picker:
Edit1: You will probably need to edit the CSS to use your own color scheme or images, but I think it'll cover all your needs.
Edit2:
You can use the jquery.com based CSS or download, change, and reference them locally.
<html lang="en">
<head>
<meta charset="utf-8" />
<title>jQuery UI Datepicker - Default functionality</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
<script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<script>
$(function() {
$( "#datepicker" ).datepicker();
});
</script>
</head>
<body>
<p>Date: <input type="text" id="datepicker" /></p>
</body>
</html>
Upvotes: 0
Reputation: 632
Here is a php calendar. http://keithdevens.com/software/php_calendar Hope this will help.
Upvotes: 1
Reputation: 6355
I agree with @Matthew--there are literally 100s... and in general if you can avoid re-inventing the wheel--do so. If you want something that will look good with your layout, check these out:
http://amsul.github.com/pickadate.js/themes.htm
Upvotes: 1
Reputation: 9949
There are literally hundreds of Javascript calendars to choose from. This site here actually has a category for it: http://www.javascriptkit.com/script/cutindex1a.shtml
I suggest googling something like css javascript calendar
. That can give you your controls, etc. Then you need to figure out how you will be passing your dates (AJAX calls or page post backs to load the data from different months). Either way, if you start with a JavaScript calendar (and layout) you like, it will get you on the right path.
Note: most calendars you will see will be date-pickers for filling forms, but even these can be easily adapted if you find one you like.
Upvotes: 0