-
Notifications
You must be signed in to change notification settings - Fork 369
use ET timezone consistently in the admin UI #693
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
f29049a
use ET timezone consistently in the admin UI
jtmkrueger 0e3cdf1
use session TZ; fix tests; change to using MST in new tests
jtmkrueger e1fb04c
Update table to use local time format (could be 12 hour time).
GUI f905b2e
Use the same application timezone for displaying metadata times.
GUI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,23 @@ | ||
| import { helper } from '@ember/component/helper'; | ||
| import Helper from '@ember/component/helper'; | ||
| import { inject } from '@ember/service'; | ||
| import isString from 'lodash-es/isString'; | ||
| import moment from 'moment-timezone'; | ||
|
|
||
| export function formatDate(params) { | ||
| let date = params[0]; | ||
| let format = params[1]; | ||
| export default class FormatDate extends Helper { | ||
| @inject session; | ||
|
|
||
| if(!format || !isString(format)) { | ||
| format = 'YYYY-MM-DD HH:mm Z'; | ||
| } | ||
| compute(positional) { | ||
| let date = positional[0]; | ||
| let format = positional[1]; | ||
|
|
||
| if(!format || !isString(format)) { | ||
| format = 'YYYY-MM-DD LT z'; | ||
| } | ||
|
|
||
| if(date) { | ||
| return moment(date).format(format); | ||
| } else { | ||
| return ''; | ||
| if(date) { | ||
| return moment(date).tz(this.session.data.authenticated.analytics_timezone).format(format); | ||
| } else { | ||
| return ''; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| export default helper(formatDate); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test looks good, but there's one other semi-related test that's failing now: https://github.com/NatLabRockies/api-umbrella/actions/runs/21634777879/job/62359925312#step:5:385
api-umbrella/test/apis/admin/stats/test_users.rb
Lines 99 to 112 in 1cb2bd5
I think you'll need to update those tests to call
user1.created_at.utc.iso8601and then updated the hard-coded"2015-01-16 00:00:00"strings into ISO8601 format.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thank you! I was trying to figure out what I was missing on these failures. Fixed!