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 WeekTimeline.vue #192

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Kanbuduo
Copy link

@Kanbuduo Kanbuduo commented Jul 6, 2023

fix: When { locale: ‘zh-CN’ }, the weekly mode is displayed abnormally

Checklist

Please put "X" in the below checkboxes that apply::

  • If committing a bugfix, I have tested it in different browsers (Chrome, Firefox, Safari).
  • If committing a new feature, I have first submitted an issue (Please note: you are free to open PRs for non-issued features, but opening an issue increases your chance of a successful PR).
  • If committing a new feature, I have also written an appropriate test suite for it.

I have tested the following:

  • Qalendar component in month mode.
  • Qalendar component in week mode.
  • Qalendar component in day mode.
  • All of the above modes on emulated mobile view.
  • Dragging and dropping events.
  • Resizing events in day/week modes.
  • Clicking events to open event dialog.

This PR solves the following problem**.

insert your description.

How to test this PR**.

For example:

  1. Feed X and Y in the events-Prop.
  2. Click Z or A.
  3. Confirm that B is displayed.

fix: When { locale: ‘zh-CN’ }, the weekly mode is displayed abnormally
Copy link
Owner

@tomosterlund tomosterlund left a comment

Choose a reason for hiding this comment

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

Thanks a lot for adding this. I hadn't noticed that the day names are completely off in Chinese! I appreciate your contribution.

Here a couple of suggestions for improving semantic clarity.

Also this will need unit tests (in WeekTimeline.test.ts). Do you want to add them yourself? If not, I can also do it.

@@ -89,6 +89,10 @@ export default defineComponent({

return date;
},
getWeekTimeStr(day: dayInterface) {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
getWeekTimeStr(day: dayInterface) {
getDayName(day: dayInterface) {

@@ -89,6 +89,10 @@ export default defineComponent({

return date;
},
getWeekTimeStr(day: dayInterface) {
const isCN = this.config?.locale?.toLowerCase() === 'zh-cn';
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
const isCN = this.config?.locale?.toLowerCase() === 'zh-cn';
const isChinese = this.config?.locale?.toLowerCase() === 'zh-cn';

@coveralls
Copy link

Coverage Status

coverage: 96.773% (-0.01%) from 96.783% when pulling 49ba980 on Kanbuduo:patch-1 into 873e4c2 on tomosterlund:master.

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