Skip to content

Make GTime support multiple formats#2933

Merged
gqcn merged 7 commits into
gogf:masterfrom
bigger-boss:master
Sep 13, 2023
Merged

Make GTime support multiple formats#2933
gqcn merged 7 commits into
gogf:masterfrom
bigger-boss:master

Conversation

@bigger-boss
Copy link
Copy Markdown
Contributor

Make GTime method support multiple formats

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 5, 2023

Codecov Report

Patch coverage: 78.57% and project coverage change: +0.01% 🎉

Comparison is base (5219c5c) 79.08% compared to head (fb99f97) 79.09%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2933      +/-   ##
==========================================
+ Coverage   79.08%   79.09%   +0.01%     
==========================================
  Files         643      643              
  Lines       52744    52748       +4     
==========================================
+ Hits        41710    41722      +12     
+ Misses       8952     8944       -8     
  Partials     2082     2082              
Flag Coverage Δ
go-1.18-386 79.18% <78.57%> (?)
go-1.18-amd64 79.13% <78.57%> (+0.03%) ⬆️
go-1.19-386 79.04% <78.57%> (+0.05%) ⬆️
go-1.19-amd64 79.03% <78.57%> (-0.02%) ⬇️
go-1.20-386 79.07% <78.57%> (?)
go-1.20-amd64 79.11% <78.57%> (-0.05%) ⬇️
go-1.21-386 79.09% <78.57%> (+<0.01%) ⬆️
go-1.21-amd64 79.14% <78.57%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
os/gtime/gtime.go 86.99% <62.50%> (+0.05%) ⬆️
util/gconv/gconv_time.go 94.54% <100.00%> (+0.31%) ⬆️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gqcn
Copy link
Copy Markdown
Member

gqcn commented Sep 5, 2023

@bigger-boss What is the business scenario for?

@bigger-boss
Copy link
Copy Markdown
Contributor Author

The time string my

@bigger-boss What is the business scenario for?

The time data string may not only come from a fixed format front-end component, but also from some sources without a fixed format, such as a column in an Excel table. Different users may use 2023 / 09 / 05 or 2023-09-05 or other formats to express time, which is not easy to control. The parameters here are variable, giving me the first impression that there may not be one, or there may be multiple. However, it was found that multiple types did not work.

@gqcn
Copy link
Copy Markdown
Member

gqcn commented Sep 11, 2023

The time string my

@bigger-boss What is the business scenario for?

The time data string may not only come from a fixed format front-end component, but also from some sources without a fixed format, such as a column in an Excel table. Different users may use 2023 / 09 / 05 or 2023-09-05 or other formats to express time, which is not easy to control. The parameters here are variable, giving me the first impression that there may not be one, or there may be multiple. However, it was found that multiple types did not work.

I see. There is another function ParseTimeFromContent should also be updated, and associated the comments of the functions should also be updated.

Comment thread util/gconv/gconv_time.go
@gqcn
Copy link
Copy Markdown
Member

gqcn commented Sep 12, 2023

@bigger-boss I see the ci failed. Please pull the latest master branch of the main repo git pull https://github.com/gogf/gf master and push your branch again.

Comment thread util/gconv/gconv_time.go Outdated
@bigger-boss bigger-boss requested a review from gqcn September 13, 2023 02:13
@gqcn gqcn merged commit e684eae into gogf:master Sep 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants