Skip to content

Commit

Permalink
more fixes for time formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Jan 7, 2025
1 parent b7a0702 commit d1993c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions wxmplot/basepanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,10 +328,10 @@ def __date_format(self, x):
tmax = dates.num2date(tmax).timestamp()
nsec = (tmax - tmin)
fmt = "%H:%M\n%S"
frac = "%.3f"
frac = None
if nsec < 0.1:
frac = "%.6f"
fmt = "%H:%M\n%S"
fmt = "%M:%S\n"
elif nsec < 25:
frac = "%.3f"
fmt = "%H:%M\n%S"
Expand All @@ -343,6 +343,7 @@ def __date_format(self, x):
fmt = "%m/%d\n%H:%M"
else:
fmt = "%m/%d"

dtval = dates.num2date(x)
try:
out = dtval.strftime(fmt)
Expand Down

0 comments on commit d1993c6

Please sign in to comment.