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

Update date in page title correctly #13697

Merged
merged 1 commit into from Nov 13, 2018
Merged

Update date in page title correctly #13697

merged 1 commit into from Nov 13, 2018

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented Nov 11, 2018

replaces #13696
fixed #13649

@sgiehl sgiehl added the Needs Review PRs that need a code review label Nov 11, 2018
@sgiehl sgiehl added this to the 3.7.0 milestone Nov 11, 2018
@sgiehl sgiehl added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Nov 11, 2018
if (0 === originalTitle.indexOf(piwik.siteName)) {
var dateString = ' - ' + piwikPeriods.parse(period, date).getPrettyString() + ' ';
document.title = piwik.siteName + dateString + originalTitle.substr(piwik.siteName.length);
}
Copy link
Member

Choose a reason for hiding this comment

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

Are there any cases where the date should be added and the document title does not include the site name? If there are, then this won't add the dates to those titles.

Copy link
Member Author

Choose a reason for hiding this comment

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

Wasn't 100% sure if that might be the case somewhere. That's the reason for the if.
But the target was to put the date after the website name again. See https://github.com/matomo-org/matomo/pull/12222/files#diff-1eb3ce37602c6f5a47792ccdf0bce2ff

Copy link
Member

Choose a reason for hiding this comment

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

I see... actually since the site/period is used to query report data, I don't think it would make sense for this case to occur. The period should only be there if the site is there... Actually nevermind, it might affect the all websites dashboard? I'll test locally today sometime.

Choose a reason for hiding this comment

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

your solution solves my problem, thank you. see #13696

@mattab mattab merged commit 50040d5 into 3.x-dev Nov 13, 2018
@sgiehl sgiehl deleted the datepagetitle branch November 13, 2018 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad position of the date in the title
4 participants