JSFiddle - React, Tailwind, and code Playground

by Lucille Kenney

HTML

<script src="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.1.0/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.9.0/jquery-ui.min.js"></script>
<script src="https://github.com/harvesthq/chosen/raw/master/chosen/chosen.jquery.js"></script>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/themes/base/jquery-ui.css">
<link rel="stylesheet" href="https://raw.github.com/harvesthq/chosen/master/chosen/chosen.css">
<script src="https://github.com/pixelmatrix/uniform/raw/master/jquery.uniform.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.10.0/jquery.validate.js"></script>
<main class="row" id="content" tabindex="-1">

    <!-- Page Title ... every page needs an h1 tag -->
    <div class="container">
        <div class="row">
            <div class="col-md-12">
              <h1 class="banner step-tracker">Tutor Hours <small>Lorem Ipsum</small>
                <span class="title-icon">
                  <img src="images/book-icon-sm.png" alt="">
                </span>
              </h1>
            </div>
        </div>
    </div>

    <div class="panel">
        <div class="panel-body">
            <!-- Modal button to access time card input fields -->
            <!-- data-target is the id of the item that you want to activate when somebody clicks on this button. -->
            <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#timecard-form">Timecard Form</button>
        </div><!--panel-body-->
    </div><!--panel-->


<!-- Tutor Hours -->
<div class="container">
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h2 class="panel-title">Report Hours</h2>
        </div>
        <div class="panel-body">
            <table id="reportHours" class="display nowrap" cellspacing="0" width="100%">
                <thead>
                    <tr>
                        <th>Date</th>
                   ...

CSS

@import url('http://twitter.github.com/bootstrap/assets/css/bootstrap.css');

@import url('http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css');

.container {
    margin-top: 10px;
}

.dropdown-menu {
    top: 0;
}

/* Copied from https://github.com/pixelmatrix/uniform/blob/master/themes/aristo/uniform.aristo.css */

div.selector, 
div.selector span,
div.checker span,
div.radio span,
div.uploader,
div.uploader span.action {
  background-image: url('https://github.com/pixelmatrix/uniform/raw/master/themes/aristo/images/sprite-aristo.png');
  background-repeat: no-repeat;
}

.selector, 
.radio, 
.checker, 
.uploader, 
.selector *, 
.radio *, 
.checker *, 
.uploader *{
    margin: 0;
    padding: 0;
}

/* SPRITES */

/* Select */

div.selector {
  background-position: -483px -160px;
  line-height: 32px;
    height: 32px;
}

div.selector span {
  background-position: right 0px;
  height: 32px;
    line-height: 32px;
}

div.selector select {
  /* change these to adjust positioning of select element */
  top: 0px;
    left: 0px;
}

div.selector:active, 
div.selector.active {
    background-position: -483px -192px;
}

div.selector:active span, 
div.selector.active span {
    background-position: right -32px;
}

div.selector.focus, div.selector.hover, div.selector:hover {
    background-position: -483px -224px;
}

div.selector.focus span, div.selector.hover span, div.selector:hover span {
    background-position: right -64px;
}

div.selector.focus:active,
div.selector.focus.active,
div.selector:hover:active,
div.selector.active:hover {
    background-position: -483px -256px;
}

div.selector.focus:active span,
div.selector:hover:active span,
div.selector.active:hover span,
div.selector.focus.active span {
    background-position: right -96px;
}

div.selector.disabled,
div.selector.disabled:active,
div.selector.disabled.active {
    background-position: -483px -288px;
}

div.selector.disabled span,
div.selector.disabled:active...

JavaScript

$(function () {
  $('#datepicker').datepicker({
    showOn: 'button',
    buttonImage: "images/calendar.png", // File (and file path) for the calendar image
    buttonImageOnly: false,
    buttonText: 'Calendar View',
    dayNamesShort: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
    showButtonPanel: true,
    closeText: 'Close',
    onClose: removeAria
  });
  
  // Add aria-describedby to the button referring to the label
  $('.ui-datepicker-trigger').attr('aria-describedby', 'datepickerLabel');
  
  dayTripper();

});


function dayTripper() {
  $('.ui-datepicker-trigger').click(function () {
    setTimeout(function () {
      var today = $('.ui-datepicker-today a')[0];

      if (!today) {
        today = $('.ui-state-active')[0] ||
                $('.ui-state-default')[0];
      }

    
      // Hide the entire page (except the date picker)
      // from screen readers to prevent document navigation
      // (by headings, etc.) while the popup is open
      $("main").attr('id','dp-container');
      $("#dp-container").attr('aria-hidden','true');
      $("#skipnav").attr('aria-hidden','true');

      

      // Hide the "today" button because it doesn't do what 
      // you think it supposed to do
      $(".ui-datepicker-current").hide();

      today.focus();
      datePickHandler();

    }, 0);
  });
}

function datePickHandler() {
  var activeDate;
  var container = document.getElementById('ui-datepicker-div');
  var input = document.getElementById('datepicker');
  
  if (!container || !input) {
    return;
  }

  $(container).find('table').first().attr('role', 'grid');

  container.setAttribute('role', 'application');
  container.setAttribute('aria-label', 'Calendar view date-picker');

    // the top controls:
  var prev = $('.ui-datepicker-prev', container)[0],
      next = $('.ui-datepicker-next', container)[0];


// This is the line that needs to be fixed for use on pages with base URL set in head
  next.href =...