質問編集履歴
3
修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -6,71 +6,71 @@
|
|
6
6
|
|
7
7
|
```json
|
8
8
|
|
9
|
-
|
9
|
+
|
10
10
|
|
11
|
-
|
11
|
+
{"res":
|
12
12
|
|
13
|
-
|
13
|
+
{"ScheduleData":[
|
14
14
|
|
15
|
-
|
15
|
+
{
|
16
16
|
|
17
|
-
|
17
|
+
"id":"0001",
|
18
18
|
|
19
|
-
|
19
|
+
"title":"サンプル01",
|
20
20
|
|
21
|
-
|
21
|
+
"day":[
|
22
22
|
|
23
|
-
|
23
|
+
{
|
24
24
|
|
25
|
-
|
25
|
+
"year":"2018",
|
26
26
|
|
27
|
-
|
27
|
+
"month":"03",
|
28
28
|
|
29
|
-
|
29
|
+
"_day":"31"
|
30
30
|
|
31
|
-
|
31
|
+
}
|
32
32
|
|
33
|
-
|
33
|
+
],
|
34
34
|
|
35
|
-
|
35
|
+
"appoint_1":"単体テスト",
|
36
36
|
|
37
|
-
|
37
|
+
"appoint_2":"javascript勉強会",
|
38
38
|
|
39
|
-
|
39
|
+
"appoint_3":"新規プロジェクトキックオフ",
|
40
40
|
|
41
|
-
|
41
|
+
},
|
42
42
|
|
43
|
-
|
43
|
+
{
|
44
44
|
|
45
|
-
|
45
|
+
"id":"0002",
|
46
46
|
|
47
|
-
|
47
|
+
"title":"サンプル02",
|
48
48
|
|
49
|
-
|
49
|
+
"day":[
|
50
50
|
|
51
|
-
|
51
|
+
{
|
52
52
|
|
53
|
-
|
53
|
+
"year":"2018",
|
54
54
|
|
55
|
-
|
55
|
+
"month":"04",
|
56
56
|
|
57
|
-
|
57
|
+
"_day":"01"
|
58
58
|
|
59
|
-
|
59
|
+
}
|
60
60
|
|
61
|
-
|
61
|
+
],
|
62
62
|
|
63
|
-
|
63
|
+
"appoint_1":"会議",
|
64
64
|
|
65
|
-
|
65
|
+
"appoint_2":"要件定義",
|
66
66
|
|
67
|
-
|
67
|
+
"appoint_3":"ログ収集機能改修",
|
68
68
|
|
69
|
-
|
69
|
+
}
|
70
70
|
|
71
|
-
|
71
|
+
]}
|
72
72
|
|
73
|
-
|
73
|
+
}
|
74
74
|
|
75
75
|
|
76
76
|
|
@@ -80,48 +80,48 @@
|
|
80
80
|
|
81
81
|
```php
|
82
82
|
|
83
|
-
|
83
|
+
private function _getTail() {
|
84
84
|
|
85
|
-
|
85
|
+
|
86
86
|
|
87
|
-
|
87
|
+
$url = "jsondata.json";
|
88
88
|
|
89
|
-
|
89
|
+
$json = file_get_contents($url);
|
90
90
|
|
91
|
-
|
91
|
+
$arr = json_decode($json, true);
|
92
92
|
|
93
|
-
|
93
|
+
|
94
94
|
|
95
|
-
|
95
|
+
|
96
96
|
|
97
|
-
|
97
|
+
$tail = '';
|
98
98
|
|
99
|
-
|
99
|
+
$lastDayOfPrevMonth = new \DateTime('last day of ' . $this->yearMonth . ' -1 month');
|
100
100
|
|
101
|
-
|
101
|
+
while ($lastDayOfPrevMonth->format('w') < 6) {
|
102
102
|
|
103
|
-
|
103
|
+
$tail_pre = sprintf('<td class="gray">%d', $lastDayOfPrevMonth->format('d'));
|
104
104
|
|
105
|
-
|
105
|
+
|
106
106
|
|
107
|
-
|
107
|
+
$tail_appoint_1 = sprintf('<ul><li>%s</li>', $arr["res"]["ScheduleData"][0]["appoint_1"]); ←※1
|
108
108
|
|
109
|
-
|
109
|
+
$tail_appoint_2 = sprintf('<li>%s</li></td>', $arr["res"]["ScheduleData"][0]["appoint_2"]);
|
110
110
|
|
111
|
-
|
111
|
+
$tail = $tail_pre . $tail_appoint_1 . $tail_appoint_2 . $tail;
|
112
112
|
|
113
|
-
|
113
|
+
|
114
114
|
|
115
|
-
|
115
|
+
$lastDayOfPrevMonth->sub(new \DateInterval('P1D'));
|
116
116
|
|
117
|
-
|
117
|
+
}
|
118
118
|
|
119
|
-
|
119
|
+
return $tail;
|
120
120
|
|
121
|
-
|
121
|
+
}
|
122
122
|
|
123
123
|
|
124
124
|
|
125
125
|
```
|
126
126
|
|
127
|
-
上記のphpの
|
127
|
+
上記のphpの※1のところをforeachで回してid:0001とid:0002もそしてさらに増えても取得してカレンダーに表示できるようにしたいのですが、どのように書き換えるべきでしょうか。
|
2
改修
test
CHANGED
File without changes
|
test
CHANGED
@@ -32,11 +32,11 @@
|
|
32
32
|
|
33
33
|
13 ],
|
34
34
|
|
35
|
-
14 "appoint_1":"
|
35
|
+
14 "appoint_1":"単体テスト",
|
36
36
|
|
37
|
-
15 "appoint_2":"sc
|
37
|
+
15 "appoint_2":"javascript勉強会",
|
38
38
|
|
39
|
-
16 "appoint_3":"
|
39
|
+
16 "appoint_3":"新規プロジェクトキックオフ",
|
40
40
|
|
41
41
|
17 },
|
42
42
|
|
1
改修
test
CHANGED
File without changes
|
test
CHANGED
@@ -104,9 +104,9 @@
|
|
104
104
|
|
105
105
|
53
|
106
106
|
|
107
|
-
54 $tail_appoint_1 = sprintf('<ul><li>%s</li>', $arr["res"]["
|
107
|
+
54 $tail_appoint_1 = sprintf('<ul><li>%s</li>', $arr["res"]["ScheduleData"][0]["appoint_1"]);
|
108
108
|
|
109
|
-
55 $tail_appoint_2 = sprintf('<li>%s</li></td>', $arr["res"]["
|
109
|
+
55 $tail_appoint_2 = sprintf('<li>%s</li></td>', $arr["res"]["ScheduleData"][0]["appoint_2"]);
|
110
110
|
|
111
111
|
56 $tail = $tail_pre . $tail_appoint_1 . $tail_appoint_2 . $tail;
|
112
112
|
|