JSFiddle - React, Tailwind, and code Playground

HTML

<div class="tidyTime"></div>

JavaScript

$.fn.tidyTime = function(e) {
    var t = {
        before: "",
        after: "",
        periodOfDay: false
    };
    e = $.extend({}, t, e);
    return this.each(function(t, n) {
        var r = n;
        r.init = function() {
            if (!e.time) {
                d = new Date
            } else {
                d = new Date("Tue Jul 23 2013 " + e.time + " GMT+0100 (GMT Daylight Time)")
            }
            r.runTime(d, n, e)
        };
        r.runTime = function(e, t, n) {
            function r(e) {
                var t = e % 12;
                if (t === 0) t = 12;
                return t < 10 ? t : t
            }
            function i(e) {
                if (e == 13) {
                    return "1"
                } else {
                    return e
                }
            }
            var s = "";
            var o = "";
            pastminutes = [2, 3, 4, 6, 7, 8, 9, 11, 12, 13, 17, 18, 19, 21, 22, 23, 24, 26, 27, 28];
            tominutes = [32, 33, 34, 36, 37, 38, 39, 41, 42, 43, 44, 47, 48, 49, 51, 52, 53, 54, 56, 57, 58, 60];
            pastOn = [5, 10, 20, 25];
            toOn = [35, 40, 50, 55];
            justgone = "";
            showmampm = "";
            var u = null;
            var a = e.getHours();
            var f = e.getMinutes();
            var l = e.getSeconds();
            var c = a + f;
            if (a < 12) {
                timeofday = "in the morning"
            } else if (a < 17) {
                timeofday = "in the afternoon"
            } else if (a < 22) {
                timeofday = "in the evening"
            } else if (a < 24) {
                timeofday = "at night"
            }
            a = r(a);
            var h = jQuery.inArray(f, pastminutes) > -1;
            var p = jQuery.inArray(f, tominutes) > -1;
            var d = jQuery.inArray(f, pastOn) > -1;
            var v = jQuery.inArray(f, toOn) > -1;
            if (v) {
                thisum = 60 - f;
               ...