A JQuery plugin to show or hide content based on date and time.
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
js
LICENSE
README.md
demo.html

README.md

scheduled-content-plugin

A JQuery plugin to show or hide content based on date and time.

Installation

Download and include the plugin after including JQuery, at the bottom of your HTML file:

<!-- Include JQuery -->

<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<!-- Include Plugin -->

<script src="js/scheduled-content.js"></script>

Usage

Using the plugin, you can specify a start date, and end date, or both.

Start Date Only:

This will show the content only after a certain date.

<script>
	$('#selector').scheduleContent({
	start:'12/26/2014'
	});
</script>

End Date Only:

This will show the content only before a certain date.

<script>
	$('#selector').scheduleContent({
	end:'12/26/2014'
	});
</script>

Start And End Date:

This will show the content between two dates.

<script>
	$('#selector').scheduleContent({
	start:'12/26/2014',
	end:'12/31/2014'
	});
</script>

Date format

You can enter dates in any format accepted by javascript

Please see demo.html for a fully worked up example based on The Twelve Days Of Christmas