<div class="panel panel-default"> | <div class="panel panel-default"> | ||||
<div class="panel-body"> | <div class="panel-body"> | ||||
<button class="btn btn-primary" @click="dayClickList" data-distribution-date="<?= $distribution->date.' 00:00' ?>">Sélectionner cette distribution</button> | |||||
<button class="btn btn-primary" @click="dayClickList" data-distribution-date="<?= $distribution->date.' 00:00:00' ?>">Sélectionner cette distribution</button> | |||||
<span class="date"><?= ucfirst(strftime('%A %d %B', strtotime($distribution->date))); ?></span> | <span class="date"><?= ucfirst(strftime('%A %d %B', strtotime($distribution->date))); ?></span> | ||||
<?php | <?php | ||||
if($pointSaleDistributions && count($pointSaleDistributions) > 0) { | if($pointSaleDistributions && count($pointSaleDistributions) > 0) { |
}, | }, | ||||
dayClickList: function(event) { | dayClickList: function(event) { | ||||
var dateStr = event.currentTarget.getAttribute('data-distribution-date') ; | var dateStr = event.currentTarget.getAttribute('data-distribution-date') ; | ||||
var arr = dateStr.split(/[- :]/), | |||||
dateObject = new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]); | |||||
/*var arr = dateStr.split(/[- :]/), | |||||
dateObject = new Date(arr[0], arr[1]-1, arr[2], arr[3], arr[4], arr[5]);*/ | |||||
var dateObject = Date.parse(String(dateStr)); | |||||
console.log(dateObject) ; | console.log(dateObject) ; | ||||
//var dateObject = new Date(dateStr) ; | //var dateObject = new Date(dateStr) ; | ||||
if(this.isAvailableDate(dateObject)) { | if(this.isAvailableDate(dateObject)) { |