You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: data/udf/time.go
+20-5Lines changed: 20 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,11 @@ import (
4
4
"fmt"
5
5
"github.com/viant/toolbox"
6
6
"github.com/viant/toolbox/data"
7
+
"strings"
7
8
"time"
8
9
)
9
10
10
-
//FormatTime return formatted time, it takes an array of arguments, the first is time express, or now followed by java style time format, optional timezone and truncate format .
11
+
//FormatTime return formatted time, it takes an array of arguments, the first is time express, or now followed by java style time format, optional timezone and truncate format .
11
12
funcFormatTime(sourceinterface{}, state data.Map) (interface{}, error) {
12
13
if!toolbox.IsSlice(source) {
13
14
returnnil, fmt.Errorf("unable to run FormatTime: expected %T, but had: %T", []interface{}{}, source)
Copy file name to clipboardExpand all lines: time_format.go
+7-8Lines changed: 7 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -5,13 +5,13 @@ import (
5
5
"time"
6
6
)
7
7
8
-
//DateFormatKeyword constant 'dateFormat' key
8
+
//DateFormatKeyword constant 'dateFormat' key
9
9
varDateFormatKeyword="dateFormat"
10
10
11
-
//DateLayoutKeyword constant 'dateLayout' key
11
+
//DateLayoutKeyword constant 'dateLayout' key
12
12
varDateLayoutKeyword="dateLayout"
13
13
14
-
//DateFormatToLayout converts java date format https://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html#rfc822timezone into go date layout
14
+
//DateFormatToLayout converts java date format https://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html#rfc822timezone into go date layout
//GetTimeLayout returns time laout from passed in map, first it check if DateLayoutKeyword is defined is so it returns it, otherwise it check DateFormatKeyword and if exists converts it to dateLayout
61
-
//If neithers keys exists it panics, please use HasTimeLayout to avoid panic
59
+
//GetTimeLayout returns time laout from passed in map, first it check if DateLayoutKeyword is defined is so it returns it, otherwise it check DateFormatKeyword and if exists converts it to dateLayout
60
+
//If neithers keys exists it panics, please use HasTimeLayout to avoid panic
0 commit comments