Quick Jump ↵
Add <link href="/PATH/TO/magic/tricks/magic_calendar/magic_calendar..css" rel="stylesheet"> <script type="text/javascript" src="/PATH/TO/magic/tricks/magic_calendar/magic_calendar..js" charset="UTF-8"></script> below your <script type="text/javascript" src="/PATH/TO/magic/wand..js" charset="UTF-8"></script>
<link href="/PATH/TO/magic/tricks/magic_calendar/magic_calendar..css" rel="stylesheet"> <script type="text/javascript" src="/PATH/TO/magic/tricks/magic_calendar/magic_calendar..js" charset="UTF-8"></script>
<script type="text/javascript" src="/PATH/TO/magic/wand..js" charset="UTF-8"></script>
Add data-mjf_mcal_date_format="DATE_FORMAT" to your <input> tag where DATE_FORMAT is one from the list below…
data-mjf_mcal_date_format="DATE_FORMAT"
<input>
DATE_FORMAT
MM-dd-yyyy
MM/dd/yyyy
yyyy-MM-dd
yyyy/MM/dd
MMM dd, yyyy
MMMM dd, yyyy
Add data-mjf_mcal_time_format="TIME_FORMAT" to your <input> tag (if you'd like to include the time) where TIME_FORMAT is one from the list below…
data-mjf_mcal_time_format="TIME_FORMAT"
TIME_FORMAT
H:mm:ss ampm
H:mm ampm
Add <script type="text/javascript">$m.trick.magic_calendar = true;</script> inside your <body> tag.
<script type="text/javascript">$m.trick.magic_calendar = true;</script>
<body>
Use the examples below as a guide for building up your own!
<input type="text" name="mcal_ex_1" value="09-15-2011" size="10" data-mjf="magic_calendar" data-mjf_mcal_date_format="MM-dd-yyyy" class="input_fld input_text_small" id="mcal_ex_1">
<input type="text" name="mcal_ex_2" value="09/15/2002 2:30:00 pm" size="25" data-mjf="magic_calendar" data-mjf_mcal_date_format="MM/dd/yyyy" data-mjf_mcal_time_format="H:mm:ss ampm" class="input_fld input_text_small" id="mcal_ex_2">
<input type="text" name="mcal_ex_3" value="2002-09-15" size="10" data-mjf="magic_calendar" data-mjf_mcal_date_format="yyyy-MM-dd" class="input_fld input_text_small" id="mcal_ex_3">
<input type="text" name="mcal_ex_4" value="2002/09/15 1:00 pm" size="25" data-mjf="magic_calendar" data-mjf_mcal_date_format="yyyy/MM/dd" data-mjf_mcal_time_format="H:mm ampm" class="input_fld input_text_small" id="mcal_ex_4">
<input type="text" name="mcal_ex_5" value="Sep 15, 2002" size="15" data-mjf="magic_calendar" data-mjf_mcal_date_format="MMM dd, yyyy" class="input_fld input_text_small" id="mcal_ex_5">
<input type="text" name="mcal_ex_6" value="September 15, 2002 9:30:10 am" size="30" data-mjf="magic_calendar" data-mjf_mcal_date_format="MMMM dd, yyyy" data-mjf_mcal_time_format="H:mm:ss ampm" class="input_fld input_text_small" id="mcal_ex_6">
<input type="text" name="mcal_ex_7" value="" size="30" data-mjf="magic_calendar" data-mjf_mcal_date_format="MMMM dd, yyyy" data-mjf_mcal_time_format="H:mm:ss ampm" class="input_fld input_text_small" id="mcal_ex_7">
24 hour times are not supported - visitors can easily become confused when entering the hour.
To set the starting year of the dropdown, add <script type="text/javascript">$m.t.magic_calendar.earliest_year = YYYY</script> inside your <head> tag. It defaults to 100 years in the past.
<script type="text/javascript">$m.t.magic_calendar.earliest_year = YYYY</script>
<head>
To set the ending year of the dropdown, add <script type="text/javascript">$m.t.magic_calendar.furthest_year = YYYY</script> inside your <head> tag. It defaults to 50 years in the future.
<script type="text/javascript">$m.t.magic_calendar.furthest_year = YYYY</script>
mcal_field_on
alert
alert()
« Back to the main documentation