Skip to content

Commit

Permalink
Optimize code
Browse files Browse the repository at this point in the history
  • Loading branch information
gouguoyin committed Jan 16, 2024
1 parent 67b173d commit 8215185
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (c Carbon) parseTag() (key, value, tz string) {
if carbon == "" {
return "layout", defaultLayout, tz
}
if len(carbon) <= 7 {
if !strings.HasPrefix(carbon, "layout:") && !strings.HasPrefix(carbon, "format:") {
return "", "", tz
}
key = strings.TrimSpace(carbon[:6])
Expand Down

0 comments on commit 8215185

Please sign in to comment.