The MIT License (MIT)

Copyright (c) 2017 mouse0270

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Out of Focus! This demo does support the use of your keyboard to change dates! But since it is contained within an iframe you must first click here!

By Day


Monday

Februray 4th

2014

By Week


Monday

Februray 4th

2014

Start Date


Monday

Februray 4th

2014


By Month


Monday

Februray 4th

2014

By Year


Monday

Februray 4th

2014

Formatting


Monday

Februray 4th

2014

@import url(http://fonts.googleapis.com/css?family=Roboto:400,300); @import url(http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css); body { padding: 70px 0px; } .fa.pull-right { margin-left: 0.1em; } .date-picker, .date-container { position: relative; display: inline-block; width: 100%; color: rgb(75, 77, 78); -webkit-touch-callout: none; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .date-container { padding: 0px 40px; } .date-picker h2, .date-picker h4 { margin: 0px; padding: 0px; font-family: 'Roboto', sans-serif; font-weight: 200; } .date-container .date { text-align: center; } .date-picker span.fa { position: absolute; font-size: 4em; font-weight: 100; padding: 8px 0px 7px; cursor: pointer; top: 0px; } .date-picker span.fa[data-type="subtract"] { left: 0px; } .date-picker span.fa[data-type="add"] { right: 0px; } .date-picker span[data-toggle="calendar"] { display: block; position: absolute; top: -7px; right: 45px; font-size: 1em !important; cursor: pointer; } .date-picker .input-datepicker { display: none; position: absolute; top: 50%; margin-top: -17px; width:100%; } .date-picker .input-datepicker.show-input { display: table; } @media (min-width: 768px) and (max-width: 1010px) { .date-picker h2{ font-size: 1.5em; font-weight: 400; } .date-picker h4 { font-size: 1.1em; } .date-picker span.fa { font-size: 3em; } }$(document).ready(function() { $(window).on('focus', function(event) { $('.show-focus-status > .alert-danger').addClass('hidden'); $('.show-focus-status > .alert-success').removeClass('hidden'); }).on('blur', function(event) { $('.show-focus-status > .alert-success').addClass('hidden'); $('.show-focus-status > .alert-danger').removeClass('hidden'); }); $('.date-picker').each(function () { var $datepicker = $(this), cur_date = ($datepicker.data('date') ? moment($datepicker.data('date'), "YYYY/MM/DD") : moment()), format = { "weekday" : ($datepicker.find('.weekday').data('format') ? $datepicker.find('.weekday').data('format') : "dddd"), "date" : ($datepicker.find('.date').data('format') ? $datepicker.find('.date').data('format') : "MMMM Do"), "year" : ($datepicker.find('.year').data('year') ? $datepicker.find('.weekday').data('format') : "YYYY") }; function updateDisplay(cur_date) { $datepicker.find('.date-container > .weekday').text(cur_date.format(format.weekday)); $datepicker.find('.date-container > .date').text(cur_date.format(format.date)); $datepicker.find('.date-container > .year').text(cur_date.format(format.year)); $datepicker.data('date', cur_date.format('YYYY/MM/DD')); $datepicker.find('.input-datepicker').removeClass('show-input'); } updateDisplay(cur_date); $datepicker.on('click', '[data-toggle="calendar"]', function(event) { event.preventDefault(); $datepicker.find('.input-datepicker').toggleClass('show-input'); }); $datepicker.on('click', '.input-datepicker > .input-group-btn > button', function(event) { event.preventDefault(); var $input = $(this).closest('.input-datepicker').find('input'), date_format = ($input.data('format') ? $input.data('format') : "YYYY/MM/DD"); if (moment($input.val(), date_format).isValid()) { updateDisplay(moment($input.val(), date_format)); }else{ alert('Invalid Date'); } }); $datepicker.on('click', '[data-toggle="datepicker"]', function(event) { event.preventDefault(); var cur_date = moment($(this).closest('.date-picker').data('date'), "YYYY/MM/DD"), date_type = ($datepicker.data('type') ? $datepicker.data('type') : "days"), type = ($(this).data('type') ? $(this).data('type') : "add"), amt = ($(this).data('amt') ? $(this).data('amt') : 1); if (type == "add") { cur_date = cur_date.add(date_type, amt); }else if (type == "subtract") { cur_date = cur_date.subtract(date_type, amt); } updateDisplay(cur_date); }); if ($datepicker.data('keyboard') == true) { $(window).on('keydown', function(event) { if (event.which == 37) { $datepicker.find('span:eq(0)').trigger('click'); }else if (event.which == 39) { $datepicker.find('span:eq(1)').trigger('click'); } }); } }); });