Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support time zone configuration #167

Merged
merged 1 commit into from
Jul 11, 2022
Merged

feat: Support time zone configuration #167

merged 1 commit into from
Jul 11, 2022

Conversation

haoel
Copy link
Contributor

@haoel haoel commented Jul 11, 2022

close #166

support the timezone configuration

settings:
  timeformat: "2006-01-02 15:04:05 Z07:00"
  # check the following link to see the time zone list
  # https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  timezone: "America/New_York" #  default: UTC

Code changes:

  1. move the timeformat from probe result to global package.
  2. add a new timezone configuration.
  3. change all of the UTC time formats to the TimeFormat() function

@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2022

Codecov Report

Merging #167 (01077ba) into main (bc50547) will increase coverage by 0.04%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #167      +/-   ##
==========================================
+ Coverage   92.22%   92.27%   +0.04%     
==========================================
  Files          46       46              
  Lines        3344     3364      +20     
==========================================
+ Hits         3084     3104      +20     
  Misses        191      191              
  Partials       69       69              
Impacted Files Coverage Δ
global/global.go 100.00% <ø> (ø)
global/probe.go 100.00% <ø> (ø)
probe/base/base.go 100.00% <ø> (ø)
probe/result.go 91.57% <ø> (-0.09%) ⬇️
conf/conf.go 80.61% <100.00%> (+0.17%) ⬆️
global/easeprobe.go 100.00% <100.00%> (ø)
report/common.go 96.59% <100.00%> (+0.16%) ⬆️
report/result.go 92.85% <100.00%> (ø)
report/sla.go 94.06% <100.00%> (-0.20%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 387b1dd...01077ba. Read the comment docs.

@@ -128,11 +128,11 @@ func ToHTML(r probe.Result) string {
<td class="data">%s</td>
</tr>
</table>
` + HTMLFooter(r.StartTime.Format(r.TimeFormat))
` + HTMLFooter(FormatTime(r.StartTime))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A quick question: Who should take the responsibility for rendering the the time on the web page? the server or the client? It has a little different from other notifiers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, the web server renders the whole web page including the time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@zhao-kun zhao-kun merged commit 13cd965 into megaease:main Jul 11, 2022
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.

The notify message's time format of WeCom always in UTC time zone
4 participants