amsul / amsul/pickadate.js

ajax call with possible dates as an object

オープン
#1,131 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
7.6k
フォーク
981
PR マージ指標
30日以内にマージされた PR はありません

説明

Hi there,

I have an Object which comes from a Magento Controller with possible Dates for the Datepicker.
I can loop through the object with an each() function but I can't access them to the Datepicker.
I want to use the datepicker for picking a Date based on a shipping method which is chosen and the datepicker have to update with new dates given from the controller.

I tried
e.g.
```javascript
function setDatepicker(data) {
$('#myinput').pickadate({
disable: [
true,
$.each(data, function(index, value) {
new Date(value)
}
],
});
}
```

and

```javascript
function setDatepicker(data) {
$('#myinput').pickadate({
disable: [
true,
data
],
)};
}
```

the Object looks like this:
`(90) ["2019,1,26", "2019,1,27", "2019,1,28", "2019,2,1", "2019,2,5", "2019,2,6", "2019,2,7", "2019,2,8", "2019,2,12", "2019,2,13", "2019,2,14"]`

and when I loop trough it with an each function it look like this:
2019,1,26
2019,1,27
2019,1,28
2019,2,1
2019,2,5
2019,2,6
2019,2,7
2019,2,8
2019,2,12
2019,2,13
2019,2,14

Is there any possibility to update it like this?

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。