質問するログイン新規登録

質問編集履歴

1

修正

2017/05/25 22:16

投稿

k499778
k499778

スコア599

title CHANGED
File without changes
body CHANGED
@@ -11,12 +11,12 @@
11
11
  public boolean getFlg() throws ParseException {
12
12
 
13
13
  SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
14
- obj.startDate = sdf.parse("2007-01-01");
14
+ Date startDate = sdf.parse("2007-01-01");
15
- obj.endDate = sdf.parse("2017-05-26");
15
+ Date endDate = sdf.parse("2017-05-26");
16
16
 
17
17
  Date now = new Date();
18
- int diff1 = now.compareTo(obj.startDate);
18
+ int diff1 = now.compareTo(startDate);
19
- int diff2 = obj.endDate.compareTo(now);
19
+ int diff2 = endDate.compareTo(now);
20
20
 
21
21
  if (diff1 >= 0 && diff2 >= 0) {
22
22
  return true;