JSFiddle - React, Tailwind, and code Playground

HTML

<label for="datepicker">Date:</label>
<br>
<input type="text" id="datepicker">


<script>
  (function(root, factory) {
    'use strict';

    var moment;
    if (typeof exports === 'object') {
      // CommonJS module
      // Load moment.js as an optional dependency
      try {
        moment = require('moment');
      } catch (e) {}
      module.exports = factory(moment);
    } else if (typeof define === 'function' && define.amd) {
      // AMD. Register as an anonymous module.
      define(function(req) {
        // Load moment.js as an optional dependency
        var id = 'moment';
        try {
          moment = req(id);
        } catch (e) {}
        return factory(moment);
      });
    } else {
      root.Pikaday = factory(root.moment);
    }
  }(this, function(moment) {
    'use strict';

    /**
     * feature detection and helper functions
     */
    var hasMoment = typeof moment === 'function',

      hasEventListeners = !!window.addEventListener,

      document = window.document,

      sto = window.setTimeout,

      addEvent = function(el, e, callback, capture) {
        if (hasEventListeners) {
          el.addEventListener(e, callback, !!capture);
        } else {
          el.attachEvent('on' + e, callback);
        }
      },

      removeEvent = function(el, e, callback, capture) {
        if (hasEventListeners) {
          el.removeEventListener(e, callback, !!capture);
        } else {
          el.detachEvent('on' + e, callback);
        }
      },

      fireEvent = function(el, eventName, data) {
        var ev;

        if (document.createEvent) {
          ev = document.createEvent('HTMLEvents');
          ev.initEvent(eventName, true, false);
          ev = extend(ev, data);
          el.dispatchEvent(ev);
        } else if (document.createEventObject) {
          ev = document.createEventObject();
          ev = extend(ev, data);
          el.fireEvent('on' + eventName, ev);
        }
      },

      trim = function(str) {
       ...

CSS

#myButt button {
  position: absolute;
  margin: -17px 0px 0px -5px;
  border: none;
  width: 22px;
  height: 22px;
  line-height: 10px;
  color: #FFF;
  text-align: center;
  background-color: #CCC;
  -moz-border-radius: 10px;
  -webkit-border-radius: 10px;
  border-radius: 10px;
  cursor: pointer;
}

#myButt button:hover {
  background-color: #999;
}

.pika-new {
  position: absolute;
  top: 0;
  right: 0;
}
.pika-single {
  z-index: 9999;
  display: block;
  position: relative;
  color: #333;
  background: #fff;
  border: 1px solid #ccc;
  border-bottom-color: #bbb;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
/*
clear child float (pika-lendar), using the famous micro clearfix hack
http://nicolasgallagher.com/micro-clearfix-hack/
*/

.pika-single:before,
.pika-single:after {
  content: " ";
  display: table;
}

.pika-single:after {
  clear: both
}

.pika-single {
  *zoom: 1
}

.pika-single.is-hidden {
  display: none;
}

.pika-single.is-bound {
  position: absolute;
  box-shadow: 0 5px 15px -5px rgba(0, 0, 0, .5);
}

.pika-lendar {
  float: left;
  width: 240px;
  margin: 8px;
}

.pika-title {
  position: relative;
  text-align: center;
}

.pika-label {
  display: inline-block;
  *display: inline;
  position: relative;
  z-index: 9999;
  overflow: hidden;
  margin: 0;
  padding: 5px 3px;
  font-size: 14px;
  line-height: 20px;
  font-weight: bold;
  background-color: #fff;
}

.pika-title select {
  cursor: pointer;
  position: absolute;
  z-index: 9998;
  margin: 0;
  left: 0;
  top: 5px;
  filter: alpha(opacity=0);
  opacity: 0;
}

.pika-prev,
.pika-next {
  display: block;
  cursor: pointer;
  position: relative;
  outline: none;
  border: 0;
  padding: 0;
  width: 20px;
  height: 30px;
  /* hide text using text-indent trick, using width value (it's enough) */
  text-indent: 20px;
  white-space: nowrap;
  overflow: hidden;
  background-color: transparent;
  background-position: center center;
  background-repeat: no-repeat;
 ...

JavaScript

var picker = new Pikaday({
    field: document.getElementById('datepicker'),
    firstDay: 1,
    minDate: new Date(2000, 0, 1),
    maxDate: new Date(2020, 12, 31),
    yearRange: [2000, 2020],
    onDraw: function() {
      var prevButt = this.el.querySelector('.pika-prev');
      prevButt.parentNode.insertBefore(myButt, prevButt);
    }
  }),
  myButt = document.createElement('div'),
  el;

myButt.id = 'myButt';
myButt.className = 'pika-new';
el = myButt.appendChild(document.createElement('button'));
el.type = 'button';
el.appendChild(document.createTextNode('x'));
myButt.addEventListener('click', function() {
  picker.hide();
}, false);