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 copyright year display in the bottom of site page #224 #226

Closed
wants to merge 1 commit into from

Conversation

cdfive
Copy link
Contributor

@cdfive cdfive commented Jan 2, 2019

What is the purpose of the change

Update copyright year display in the bottom of site page.

Fixes #224

Brief changelog

Use new Date().getFullYear() to get the current Year, if it's greater than 2018, add it after the 2018.

Using getFullYear, when the next year is coming, the code need't to modify;

Add the if check to avoid the user's client time less or equal than 2018, which will meet most condition.

@Ruffianjiang
Copy link

I think it not a good idea. First, new Date().getFullYear() relies on PC's local time. Second, there are some browsers that disable JavaScript and fail to display correctly and universally.

@ralf0131
Copy link

ralf0131 commented Jan 2, 2019

Hi,

I agree with @Ruffianjiang , it is better to have static number here.

Since #225 has been merged. I am going to close this pr.

Again, thanks for your contribution, your passion has been warmly accepted. :)

Hope you can contribute further in the future!

@ralf0131 ralf0131 closed this Jan 2, 2019
@cdfive
Copy link
Contributor Author

cdfive commented Jan 2, 2019

@Ruffianjiang @ralf0131
Considering the user's local time, I add fault-tolerant judgment:
((new Date().getFullYear() > 2018) ? ('-' + new Date().getFullYear()) : '')

If the user's local time is moving backwards or has other errors,only the 2018 will be displayed.
The point is to need't modify when the year passed by, and in most condition is right.

But in indeed,I didn't test disabling JavaScript condition.

Also agree with that using static number is an easy and safe way, the only “deficiency”
is that it needs to update next year.

By the way, the #225 add the 2019 for 'en-us', but the 'zh-cn' seems be omitted, need to be added?

@ralf0131
Copy link

ralf0131 commented Jan 2, 2019

By the way, the #225 add the 2019 for 'en-us', but the 'zh-cn' seems be omitted, need to be added?

Yes! Please go ahead and fix it!

@cdfive
Copy link
Contributor Author

cdfive commented Jan 2, 2019

By the way, the #225 add the 2019 for 'en-us', but the 'zh-cn' seems be omitted, need to be added?

Yes! Please go ahead and fix it!

ok, I‘ve added it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants