JSFiddle - React, Tailwind, and code Playground
by Dhruvang Gajjar
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.4/moment.min.js"></script>
<div id="countdown-clock2" class="well"></div>
JavaScript
! function(s) {
s.fn.countdownClock = function(s) {
var n = this;
try {
if ("undefined" == typeof moment) throw "** Moment.js is a required dependency for the countdownClock plugin."
} catch (o) {
return void console.log(o)
}
var t = ["date", "showYears", "showMonths", "showDays", "showHours", "showMinutes", "showSeconds", "updateInterval"];
if (n.options = {
dateFormat: "YYYY-MM-DD",
date: void 0,
showYears: !1,
showMonths: !0,
showDays: !0,
showHours: !0,
showMinutes: !0,
showSeconds: !0,
updateInterval: 1,
containerClass: "countdown-clock cf",
containerTag: "div"
}, "undefined" != typeof s)
for (key in s) - 1 !== t.indexOf(key) && (n.options[key] = s[key]);
try {
if ("undefined" == typeof n.options.date) throw '** Countdown-Clock requires a "date" parameter set! $("#el").({date: "' + n.options.dateFormat + '");'
} catch (o) {
return void console.log(o)
}
return n.renderTemplate = function() {
var s = "";
n.options.showYears && (s += "<span class='years'></span> Years "), n.options.showMonths && (s += "<div class='box1'><span class='months'></span><div>Months</div></div>"), n.options.showDays && (s += "<div class='box1'><span class='days'></span><div>Days</div></div>"), n.options.showHours && (s +=
"<div class='box1'><span class='hours'></span> <div>Hours</div></div>"), n.options.showMinutes && (s += "<div class='box1'><span class='minutes'></span> <div>Minutes</div></div>"), n.options.showSeconds && (s += "<span class='seconds'></span> Seconds "), s = "<" + n.options.containerTag +
' class="' + n.options.containerClass + '">' + s + "</" + n.options.containerTag + ">", n.html(s)
}, n.renderTemplate(), n.el = function() {
return {
years: n.find("span.years"),
months: n.find("span.months"),
days:...