質問編集履歴

1

解決できました

2018/08/10 04:20

投稿

Kentaro0919
Kentaro0919

スコア258

test CHANGED
File without changes
test CHANGED
@@ -91,3 +91,57 @@
91
91
 
92
92
 
93
93
  何かいい方法はありますか?
94
+
95
+ ```python
96
+
97
+ import maya
98
+
99
+ import datetime
100
+
101
+
102
+
103
+ start_day = maya.when("15 month")
104
+
105
+
106
+
107
+ first_day = lambda year, month: datetime.date(year, month, 1).strftime('%Y-%m-%d')
108
+
109
+
110
+
111
+ [maya.when(f"{first_day(start_day.year, start_day.month)} + {a} month").iso8601() for a in range(1, 16)]
112
+
113
+
114
+
115
+ ['2018-07-01',
116
+
117
+ '2018-06-01',
118
+
119
+ '2018-05-01',
120
+
121
+ '2018-04-01',
122
+
123
+ '2018-03-01',
124
+
125
+ '2018-02-01',
126
+
127
+ '2018-01-01',
128
+
129
+ '2017-12-01',
130
+
131
+ '2017-11-01',
132
+
133
+ '2017-10-01',
134
+
135
+ '2017-09-01',
136
+
137
+ '2017-08-01',
138
+
139
+ '2017-07-01',
140
+
141
+ '2017-06-01',
142
+
143
+ '2017-05-01']
144
+
145
+
146
+
147
+ ```