Skip to content

Commit

Permalink
fix(ui): fix timestamp formatting (#551)
Browse files Browse the repository at this point in the history
When filtering topic data by `timestamp` and also when fetching offsets
for consumer groups by `datetime` we seem to be formatting the hour of
the timestamp using `hh`. In moment.js, this causes the hour to always
have a range between [0-12](https://momentjs.com/docs/#/displaying/format/)
even though even though the api expects a range between 0-24. This prevents
filtering of timestamp or fetching of offsets for any time greater than 12:59
on any given day.

This PR corrects this by changing `hh` to `HH` on the formatting calls.

close #550
  • Loading branch information
tamimkh committed Dec 22, 2020
1 parent 58da7ca commit 470d1de
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ConsumerGroupUpdate extends Form {
second: momentValue.second(),
milli: momentValue.millisecond()
},
'YYYY-MM-DDThh:mm:ss.SSS'
'YYYY-MM-DDTHH:mm:ss.SSS'
) + 'Z'
: '';

Expand Down
2 changes: 1 addition & 1 deletion client/src/containers/Topic/Topic/TopicData/TopicData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ class TopicData extends Root {
second: timestamp.second(),
milli: timestamp.millisecond()
},
'YYYY-MM-DDThh:mm:ss.SSS',
'YYYY-MM-DDTHH:mm:ss.SSS',
true
) + 'Z';
filters.push(`timestamp=${timestamp}`);
Expand Down

0 comments on commit 470d1de

Please sign in to comment.