回答編集履歴

5

修正

2021/06/21 03:04

投稿

退会済みユーザー
test CHANGED
@@ -18,31 +18,33 @@
18
18
 
19
19
  var message = "";
20
20
 
21
+
22
+
21
23
  for (var i = 1; i <= column; i++) {
22
24
 
23
25
  var item = range.getCell(1, i).getValue(); //1行目
24
26
 
25
- var value = new Date(range.getCell(row, i).getValue()); //最終行
27
+ var value = range.getCell(row, i).getValue(); //最終行
26
28
 
27
- if (value == null) continue;
29
+ if (item == "タイムスタンプ" || item == "出勤日" || item == "退勤日"){
28
30
 
29
- var weeks = ["日","月","火","水","木","金","土"];
31
+ var date = new Date(value)
30
32
 
31
- var weekstr = weeks[value.getDay()];
33
+ var weeks = ["日","月","火","水","木","金","土"];
32
34
 
33
- var ymd = Utilities.formatDate(value, "Asia/Tokyo", "yyyy/MM/dd");
35
+ var weekstr = weeks[date.getDay()];
34
36
 
35
-
36
-
37
- if (item == "タイムスタンプ"){
38
-
39
- var hms = Utilities.formatDate(value, "Asia/Tokyo", "HH:mm:ss");
37
+ var ymd = Utilities.formatDate(date, "Asia/Tokyo", "yyyy/MM/dd");
40
-
41
- value = ymd + "(" + weekstr + ") " + hms;
42
-
43
- }else if (item == "出勤日" || item == "退勤日") {
44
38
 
45
39
  value = ymd + "(" + weekstr + ")"
40
+
41
+ if (item == "タイムスタンプ"){
42
+
43
+ var hms = Utilities.formatDate(date, "Asia/Tokyo", "HH:mm:ss");
44
+
45
+ value += " " + hms;
46
+
47
+ }
46
48
 
47
49
  }
48
50
 

4

修正

2021/06/21 03:04

投稿

退会済みユーザー
test CHANGED
@@ -23,6 +23,8 @@
23
23
  var item = range.getCell(1, i).getValue(); //1行目
24
24
 
25
25
  var value = new Date(range.getCell(row, i).getValue()); //最終行
26
+
27
+ if (value == null) continue;
26
28
 
27
29
  var weeks = ["日","月","火","水","木","金","土"];
28
30
 

3

修正

2021/06/20 14:01

投稿

退会済みユーザー
test CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  var item = range.getCell(1, i).getValue(); //1行目
24
24
 
25
- var value = range.getCell(row, i).getValue(); //最終行
25
+ var value = new Date(range.getCell(row, i).getValue()); //最終行
26
26
 
27
27
  var weeks = ["日","月","火","水","木","金","土"];
28
28
 

2

修正

2021/06/20 13:58

投稿

退会済みユーザー
test CHANGED
@@ -40,7 +40,7 @@
40
40
 
41
41
  }else if (item == "出勤日" || item == "退勤日") {
42
42
 
43
- value = ymd + "(" weekstr + ")"
43
+ value = ymd + "(" + weekstr + ")"
44
44
 
45
45
  }
46
46
 

1

修正

2021/06/20 09:36

投稿

退会済みユーザー
test CHANGED
@@ -36,7 +36,7 @@
36
36
 
37
37
  var hms = Utilities.formatDate(value, "Asia/Tokyo", "HH:mm:ss");
38
38
 
39
- value = ymd + "(" weekstr + ") " + hms
39
+ value = ymd + "(" + weekstr + ") " + hms;
40
40
 
41
41
  }else if (item == "出勤日" || item == "退勤日") {
42
42