-
-
Notifications
You must be signed in to change notification settings - Fork 881
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
Display gold status in userbar( Closes #1915 ) #3485
Display gold status in userbar( Closes #1915 ) #3485
Conversation
- new module option: showGold (Display gilded icon if current user has gold status) - new module function updateUserSpan (If the user has gold and would like to, display the gilded-icon in the user span.) - basically borrow a bunch of JS from various functions to make everything work smoothly. - new import needed for nice date on hover - also comments for things :)
Relates to #1915 |
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.
Otherwise LGTM; tested
if (data.gold_expiration) { | ||
const today = new Date(); | ||
const expDate = new Date(data.gold_expiration * 1000); // s -> ms | ||
$gilded.attr('title', `Until ${expDate.toDateString()} (${formatDateDiff(today, expDate)})`); |
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.
Nit: import and use formatDate(expDate)
instead of expDate.toDateString()
here
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.
Sure thing, I pulled that line from accountSwitcher (L231):
That may need to be modified as well to use formatDate(expDate)
instead of toDateString()
.
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.
Yep, looks like that needs to be changed. You could open a new PR for that if you want, or I can take care of it.
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.
I'll take care of it in a separate PR, one sec.
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.
--> #3486
FYI if you edit |
- also add appropriate import
Looks good to me! We'll get this merged soon, thanks for the contribution. |
Thanks! |
…eps#3485) * Display gold status in userbar( Closes honestbleeps#1915 ) - new module option: showGold (Display gilded icon if current user has gold status) - new module function updateUserSpan (If the user has gold and would like to, display the gilded-icon in the user span.)
gold status)
like to, display the gilded-icon in the user span.)
everything work smoothly.
Screenshot of freshly built plugin:
Passes lint & unit tests.
edit:
closes #1915