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

Add time created to persistent notifications. #1733

Merged
merged 4 commits into from
Oct 7, 2018

Conversation

jeradM
Copy link
Member

@jeradM jeradM commented Oct 4, 2018

Adds relative creation time to persistent notifications in lovelace notification drawer

Depends on home-assistant/core#17121

Closes home-assistant/ui-schema#170

notification-drawer

<hui-notification-item-template>
<span slot="header">[[_computeTitle(notification)]]</span>

<ha-markdown content="[[notification.message]]"></ha-markdown>

<ha-relative-time
Copy link
Member

Choose a reason for hiding this comment

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

Please wrap this in a paper-tooltip that shows the actual formatted date when hovered. Example

@jeradM
Copy link
Member Author

jeradM commented Oct 5, 2018

Added tooltip to show date using Date.toLocaleDateString(). It's not ideal since we only have language and not actual locale, but I think it's better than using the raw datetime string

screen shot 2018-10-04 at 5 23 14 pm

@@ -15,11 +17,29 @@ import LocalizeMixin from '../../../../mixins/localize-mixin.js';
export class HuiPersistentNotificationItem extends LocalizeMixin(PolymerElement) {
static get template() {
return html`
<style>
#time {
Copy link
Member

@balloob balloob Oct 5, 2018

Choose a reason for hiding this comment

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

IDs need to be unique on a page. This violates that

<hui-notification-item-template>
<span slot="header">[[_computeTitle(notification)]]</span>

<ha-markdown content="[[notification.message]]"></ha-markdown>

<div id="time">
Copy link
Member

Choose a reason for hiding this comment

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

notifications need to be unique.

@jeradM jeradM force-pushed the notification-time branch from 2ec480f to 1ed9fe4 Compare October 5, 2018 23:32
@jeradM jeradM force-pushed the notification-time branch from 1ed9fe4 to dd8aff9 Compare October 6, 2018 02:37
@balloob balloob merged commit c30e7ac into home-assistant:master Oct 7, 2018
@ghost ghost removed the in progress label Oct 7, 2018
zsarnett pushed a commit to zsarnett/home-assistant-polymer that referenced this pull request Oct 13, 2018
* Add time created to persistent notifications.

* Add tooltip to show actual date.

* Fix style rules.

* Fix duplicate ids.
zsarnett pushed a commit to zsarnett/home-assistant-polymer that referenced this pull request Oct 13, 2018
* Add time created to persistent notifications.

* Add tooltip to show actual date.

* Fix style rules.

* Fix duplicate ids.
zsarnett pushed a commit to zsarnett/home-assistant-polymer that referenced this pull request Oct 14, 2018
* Add time created to persistent notifications.

* Add tooltip to show actual date.

* Fix style rules.

* Fix duplicate ids.
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants