Search Posts

Category: date

Different rule for same Date object on datepicker

this is the continuation of this question. Basically i have an array of dates and i want them to be modifiable by the user, so i loop through the array and bind the dates to a datepicker. the dates are retrieved by an API and processed this way : function(date) { const dateAndTime = date.split(‘ ‘), dateParts = dateAndTime[0].split(‘-‘); dateParts.reverse(); var finalDate = dateParts.join(‘-‘) + ‘ ‘ + dateAndTime[1] + ‘.000’; return new Date(finalDate); } […]

Invalid date DatePicker

I’m pretty stucked on this problem where i have an api that return some data, in this format { “data”: { “result”: [ { “start_date”: “03-08-2017 00:00:00”, “end_date”: “01-09-2017 23:59:59” }, { “start_date”: “01-01-2017 00:00:00”, “end_date”: “31-12-2017 23:59:59″ } ] } } I want to take these data and make them modifiable by the user, so basically my html is something like that: <table class=”table” > <thead> <tr> <th class=”col-order”>{{‘START_DATE’| translate}}</th> <th class=”col-order”>{{‘END_DATE’| translate}}</th> </tr> […]