Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <nav class="navbar navbar-default navbar-theme">
  <div class="navbar-header">
    <div href="#" class="navbar-brand clearfix">
      <img class="navbar-logo" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/176621/logo.png" alt="Mk-Ui">
      <span class="navbar-details">
						<span>Components / <span class="sg-pagename">Datepicker</span></span>
      <span class="navbar-quote">A Flexible User Interface Suite Built on Accessibility.</span>
      </span>
    </div>
  </div>
  <ul class="nav navbar-top">
    <li class="active">
      <a href="https://codepen.io/MarkitOnDemand/post/mk-datepicker">Documentation</a>
    </li>
    <li>
      <a href="https://github.com/markitondemand/mk-ui">Github</a>
    </li>
    <li>
      <a href="https://github.com/markitondemand">Markit Digital</a>
    </li>
  </ul>
</nav>
<div class="container">
		  <form>
		    <ol class="list-theme row">
		    	<li class="col-sm-12">
			      	<h2 class="h-theme">Datepicker as Popups</h2>
			    	<p class="font-theme">This first example are a set of datepickers in 'standard mode,' which basically means they have a popup or 'dropdown' calendar. Also notice how the data-min and data-max attributes are css selectors. Supplying selectors instead of dates link these two elements together for dynamic min and max dates.</p>
			    	<div class="row">
			      		<div class="col-sm-6">
					        <fieldset class="mk-datepicker-container">
					          <label for="start-date">Start Date</label>
					          <input type="text" id="start-date" name="start-date" placeholder="Select Date" class="mk-datepicker-trigger" data-max="#end-date" />
					        </fieldset>
			      		</div>
			      		<div class="col-sm-6">
					        <fieldset class="mk-datepicker-container">
					          <label for="end-date">End Date</label>
					          <input type="text" id="end-date" name="end-date" placeholder="Select Date" class="mk-datepicker-trigger" data-min="#start-date" />
					        </fieldset>
			      		</div>
			    	</div>
			    </li>
				<li class="col-sm-6">
					<h2 class="h-theme">Datepicker as Inline</h2>
					<p class="font-theme">Here's an example of a datepicker with it's popup option set to false and min/max values set as date strings instead of linking elements.</p>
					<fieldset class="mk-datepicker-container">
					  <label for="inline" class="sr-only">Start Date</label>
					  <input type="text" id="inline" name="inline" placeholder="Select Date" class="mk-datepicker-trigger" data-popup="false" data-min="01/01/1990" data-max="12/31/2016" />
					</fieldset>
				</li>
				<li class="col-sm-6">
					<h2 class="h-theme">No User Entry</h2>
					<p class="font-theme">Setting readonly on your target element will disable users from entering anything they want. You can also style things specific to this setting.</p>
					<fieldset class="mk-datepicker-container">
					  <label for="readonly" class="sr-only">Start Date</label>
					  <input readonly type="text" id="readonly" name="readonly" placeholder="Select Date" class="mk-datepicker-trigger" data-popup="false" data-format="dddd mmmm dd, yyyy" />
					</fieldset>
				</li>
		    </ol>
		  </form>
		</div>
              
            
!

CSS

              
                label {
  display: block;
  text-align: center;
  width: 100%;
}

              
            
!

JS

              
                $(function () {

  var $pickers = $('.mk-datepicker-trigger');
      $pickers.mkdatepicker();
      $pickers.on('change.mk-datepicker', function(e, date) {
          console.info('formatted date: ', this.value);
          console.info('raw date object: ', date);
      });
});
              
            
!
999px

Console