JSFiddle - React, Tailwind, and code Playground

by magikMaker

HTML

<div class="content slidableContent" data-testing="cheese" data-timeslider='{                     "crDate": "2008-06-27",                     "eop": "2011-12-31",                     "sop": "2009-03-27"                   }'>
    
</div>

<div class="result"></div>

JavaScript

Date.prototype.parseISO8601 = function(date){
    var matches = date.match(/^\s*(\d{4})-(\d{2})-(\d{2})\s*$/);
    
    if(matches){
        this.setFullYear(parseInt(matches[1]));    
        this.setMonth(parseInt(matches[2]) - 1);    
        this.setDate(parseInt(matches[3]));    
    }
    
    return this;
};

var n = new Date();
n.pareseISO8601("2009-12-15");

var d = $('div.content').data();
console.log('fiddle', n);