Skip to content

Commit

Permalink
comment typos
Browse files Browse the repository at this point in the history
  • Loading branch information
CascadingRadium authored and abhinavdangeti committed Sep 13, 2023
1 parent d8d8b11 commit 659d869
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
25 changes: 14 additions & 11 deletions analysis/datetime/javatime/javatime.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@ var textLiteralDelimiter byte = '\'' // single quote
// - 'G' for era, like AD or BC.
// - 'W' for week of month.
// - 'D' for day of year.
// So date strings with date elements cannot be parsed.
// So date strings with these date elements cannot be parsed.
var timeElementToLayout = map[byte]map[int]string{
'M': {
4: "January",
3: "Jan", // MMM = short month name
2: "01", // MM = month of year (2 digits) (01-12)
1: "1", // M = month of year (1 digit) (1-12)
4: "January", // MMMM = full month name
3: "Jan", // MMM = short month name
2: "01", // MM = month of year (2 digits) (01-12)
1: "1", // M = month of year (1 digit) (1-12)
},
'd': {
2: "02", // dd = day of month (2 digits) (01-31)
1: "2", // d = day of month (1 digit) (1-31)
},
'a': {
2: "pm", // PM = PM/AM
1: "PM", // PM = PM/AM
2: "pm", // aa = pm/am
1: "PM", // a = PM/AM
},
'H': {
2: "15", // HH = hour (24 hour clock) (2 digits)
Expand All @@ -70,15 +70,15 @@ var timeElementToLayout = map[byte]map[int]string{

// timezone offsets from UTC below
'X': {
5: "Z07:00:00", // XXXXXX = timezone offset (+-hh:mm:ss)
4: "Z070000", // XXXXX = timezone offset (+-hhmmss)
5: "Z07:00:00", // XXXXX = timezone offset (+-hh:mm:ss)
4: "Z070000", // XXXX = timezone offset (+-hhmmss)
3: "Z07:00", // XXX = timezone offset (+-hh:mm)
2: "Z0700", // XX = timezone offset (+-hhmm)
1: "Z07", // X = timezone offset (+-hh)
},
'x': {
5: "-07:00:00", // xxxxxx = timezone offset (+-hh:mm:ss)
4: "-070000", // xxxxx = timezone offset (+-hhmmss)
5: "-07:00:00", // xxxxx = timezone offset (+-hh:mm:ss)
4: "-070000", // xxxx = timezone offset (+-hhmmss)
3: "-07:00", // xxx = timezone offset (+-hh:mm)
2: "-0700", // xx = timezone offset (+-hhmm)
1: "-07", // x = timezone offset (+-hh)
Expand Down Expand Up @@ -191,6 +191,9 @@ func parseJavaString(layout string) (string, error) {
}
case 'S':
// fraction of second
// .SSS = millisecond
// .SSSSSS = microsecond
// .SSSSSSSSS = nanosecond
if count > 9 {
return "", invalidFormatError(character, count)
}
Expand Down
1 change: 1 addition & 0 deletions analysis/datetime/percent/percent.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ var formatSpecifierToLayout = map[byte]string{

// some additional options for timezone
// such as allowing colon in timezone offset and specifying the seconds
// timezone offsets are from UTC
var timezoneOptions = map[string]string{
"z": "Z0700", // %z = timezone offset in +-hhmm / +-(2 digit hour)(2 digit minute) +0500, -0600 etc
"z:M": "Z07:00", // %z:M = timezone offset(+-hh:mm) / +-(2 digit hour):(2 digit minute) +05:00, -06:00 etc
Expand Down

0 comments on commit 659d869

Please sign in to comment.