Skip to content

Date picker fixed #912

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

Open
wants to merge 57 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
ca1c613
add hour and minute
Michael18811380328 Aug 24, 2019
e4459ad
change default color
Michael18811380328 Aug 24, 2019
9a16248
update readme
Michael18811380328 Aug 24, 2019
7ce76f5
update version
Michael18811380328 Aug 24, 2019
0d74040
Merge pull request #1 from seafileltd/change-calendar
freeplant Aug 24, 2019
60e568a
change default time to 08:00
Michael18811380328 Aug 26, 2019
f8d9f87
Merge pull request #2 from seafileltd/update-default-time
freeplant Aug 26, 2019
09cef9c
update version
Michael18811380328 Aug 27, 2019
fda112b
Merge pull request #3 from seafileltd/update
Michael18811380328 Aug 27, 2019
b2c7387
set right panel locale
Michael18811380328 Aug 29, 2019
ac1d780
Merge pull request #4 from seafileltd/fix-right-panel-locale
freeplant Aug 29, 2019
ef7ee7b
update version
Michael18811380328 Aug 29, 2019
270b317
update version
Michael18811380328 Aug 29, 2019
bc069c4
set Sunday as the first day of the week
Michael18811380328 Dec 3, 2019
9e9d597
Merge pull request #5 from seafileltd/set-fisrt-day-of-week
freeplant Dec 3, 2019
edea8bd
update version
Michael18811380328 Dec 3, 2019
9ade165
update version
Michael18811380328 Dec 3, 2019
79d2b62
set default locale is enUS
Michael18811380328 Apr 23, 2020
25329ed
Merge pull request #6 from seafileltd/fix-French
freeplant Apr 23, 2020
ec2f95f
update
Michael18811380328 Apr 24, 2020
1462024
change classname
Michael18811380328 May 9, 2020
10a84ad
Merge pull request #7 from seafileltd/change-class
freeplant May 9, 2020
b6f9646
update version to 0.0.12
Michael18811380328 May 9, 2020
a1565d5
change right panel click callback
Michael18811380328 Sep 1, 2020
7b2b8e6
Merge pull request #8 from seafileltd/change-click-hour-callback
freeplant Sep 2, 2020
a3e5ade
Choose precise time to improve
zxj96 Apr 9, 2021
8a8c61f
Merge pull request #9 from seafileltd/precise-time
freeplant Apr 13, 2021
0627814
dayjs replace moment
zxj96 Feb 17, 2022
a26aa3a
fix: optimizated code
zxj96 Feb 22, 2022
49e5606
Merge pull request #10 from seafileltd/dayjs-replace-moment
freeplant Feb 23, 2022
170da48
fix: caldaner width bug
zxj96 Mar 2, 2022
c0643fb
Merge pull request #11 from seafileltd/repair-width-bug
freeplant Mar 3, 2022
c6b8e99
fix: dayjs does not introduce the loaneData plugin
zxj96 Apr 20, 2022
caf7540
Merge pull request #12 from seafileltd/fix-dayjs-bug
freeplant Apr 20, 2022
90c0a84
change click first or last year
Michael18811380328 Sep 8, 2022
c298053
Merge pull request #13 from seafileltd/change-year-click-UI
freeplant Sep 13, 2022
a1d40ae
update version
Michael18811380328 Sep 13, 2022
bd295da
feat: time second
Sep 18, 2024
3104a71
feat: update code
Sep 18, 2024
f573335
feat: update code
Sep 18, 2024
6281a29
feat: update code
YangGuoXuan-0503 Sep 18, 2024
9650d96
feat: update code
YangGuoXuan-0503 Sep 18, 2024
1fbc075
feat: update version
YangGuoXuan-0503 Sep 18, 2024
dc85a50
Merge pull request #15 from seafileltd/feat-time-second
YangGuoXuan-0503 Sep 19, 2024
4320e20
support customizing the first day of week
SailingBoat762 Apr 1, 2025
42c6bca
update
SailingBoat762 Apr 1, 2025
cf40ead
update
SailingBoat762 Apr 1, 2025
302684f
opt code
SailingBoat762 Apr 9, 2025
7e56370
Merge pull request #16 from SailingBoat762/support-customizing-the-fi…
YangGuoXuan-0503 Apr 9, 2025
02b5412
fix: code problems
Apr 15, 2025
aec3142
Merge pull request #17 from seafileltd/fix-code-problems
freeplant Apr 15, 2025
5ad60a5
remove input rule
gzcqqqqqqqq1 May 23, 2025
0a67351
Time algorithm adjustment
gzcqqqqqqqq1 May 27, 2025
22d15b6
Time algorithm adjustment
gzcqqqqqqqq1 May 28, 2025
64eea29
Time algorithm adjustment
gzcqqqqqqqq1 May 28, 2025
a26175e
datepicker fix pla
gzcqqqqqqqq1 May 29, 2025
177f071
rm code
gzcqqqqqqqq1 May 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ sudo: false

notifications:
email:
- yiminghe@gmail.com
- hust2012jiangkai@gmail.com
- bing.an@seafile.com

node_js:
- 10
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ http://react-component.github.io/calendar/examples/index.html
<td>auto</td>
<td>whether has ok button in footer</td>
</tr>
<tr>
<td>showHourAndMinute</td>
<td>Boolean</td>
<td>auto</td>
<td>whether has hour-minute chooser in the right panel(for dtable date column)</td>
</tr>
<tr>
<td>timePicker</td>
<td>React Element</td>
Expand Down Expand Up @@ -225,6 +231,12 @@ http://react-component.github.io/calendar/examples/index.html
<td></td>
<td>called when ok button is pressed, only if it's visible</td>
</tr>
<tr>
<td>onClickRightPanelTime</td>
<td>Function()</td>
<td></td>
<td>called when right panel hour and minute is clicked, only prop showHourAndMinute is true</td>
</tr>
<tr>
<td>dateInputPlaceholder</td>
<td>String</td>
Expand Down Expand Up @@ -744,3 +756,6 @@ open coverage/ dir
## License

rc-calendar is released under the MIT license.

# node version
>= 18.20.4
12 changes: 6 additions & 6 deletions assets/common/FullCalendar.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
float: right;
display: inline-block;
&-normal:hover {
border-color: #23c0fa;
border-color: #f09f4g;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

修复无效的十六进制颜色值

颜色值 #f09f4g 包含无效字符 'g',这会导致 CSS 解析错误。十六进制颜色值只能包含 0-9 和 A-F 字符。

建议修复为有效的十六进制颜色值:

-        border-color: #f09f4g;
+        border-color: #f09f3f;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
border-color: #f09f4g;
border-color: #f09f3f;
🤖 Prompt for AI Agents
In assets/common/FullCalendar.less at line 22, the border-color value '#f09f4g'
contains an invalid character 'g' which is not allowed in hexadecimal color
codes. Replace this with a valid hex color code using only characters 0-9 and
A-F to fix the CSS parsing error.

box-shadow: 0 0 2px rgba(45, 183, 245, 0.8);
cursor: pointer;
}
&-focus {
border-color: #3fc7fa;
background-color: #3fc7fa;
border-color: #f09f3f;
background-color: #f09f3f;
color: #fff;
}
> span {
Expand Down Expand Up @@ -79,13 +79,13 @@
}
&-selected-day .@{prefixClass}-date,
&-month-panel-selected-cell .@{prefixClass}-month-panel-month {
background-color: #ebfaff;
background-color: #fcecd9;
color: #666;
}
&-today .@{prefixClass}-date,
&-month-panel-selected-cell .@{prefixClass}-month-panel-month {
border-top-color: #3FC7FA;
color: #3FC7FA;
border-top-color: #f09f3f;
color: #f09f3f;
}
}
}
86 changes: 76 additions & 10 deletions assets/index/Calendar.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
position: relative;
outline: none;
font-family: Arial, "Hiragino Sans GB", "Microsoft Yahei", "Microsoft Sans Serif", "WenQuanYi Micro Hei", sans-serif;
width: 253px;
width: fit-content;
border: 1px solid #ccc;
list-style: none;
font-size: 12px;
Expand All @@ -14,9 +14,15 @@
border: 1px solid #ccc;
line-height: 1.5;


&-date-panel, &-date-panel-container {
display: flex;
}

&-date-panel, &-panel {
position: relative;
outline: none;
display: block;
}

&-week-number {
Expand Down Expand Up @@ -46,7 +52,7 @@

&:hover {
cursor: pointer;
color: #23c0fa;
color: #f09f4g;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

修复颜色值中的语法错误

颜色值 #f09f4g 包含无效的十六进制字符 'g',这会导致 CSS 解析错误。

修复颜色值语法错误:

-        color: #f09f4g;
+        color: #f09f4f;

请在所有出现 #f09f4g 的地方进行相同的修复。

Also applies to: 88-88, 111-111, 347-347

🤖 Prompt for AI Agents
In assets/index/Calendar.less at lines 55, 88, 111, and 347, the color value
'#f09f4g' contains an invalid hexadecimal character 'g', causing CSS parsing
errors. Replace all occurrences of '#f09f4g' with a valid hex color code by
correcting the invalid character to a valid hex digit (0-9, a-f). Ensure the
corrected color value is consistent across all mentioned lines.

}
}

Expand Down Expand Up @@ -79,7 +85,7 @@

&:hover {
cursor: pointer;
color: #23c0fa;
color: #f09f4g;
}
&.@{prefixClass}-time-status:hover{
cursor: pointer;
Expand All @@ -102,7 +108,7 @@
line-height: 34px;

&:hover {
color: #23c0fa;
color: #f09f4g;
}
}

Expand All @@ -127,6 +133,66 @@
height: 217px;
}

&-right-panel {
width: 68px;
height: inherit;
}

&-right-panel-header {
height: 34px;
line-height: 34px;
span {
transform: rotate(-90deg);
}
}

&-right-panel-body {
height: 217px;
border-left: 1px solid #ccc;
overflow-y: scroll;
ul {
list-style: none;
box-sizing: border-box;
margin: 0;
padding: 0;
width: 100%;
}
ul li {
text-align: center;
padding: 8px 0;
cursor: pointer;
}
ul li:hover {
color: #e8bf6a;
}
.@{prefixClass}-selected-time {
color: #f09f3f;
}
&::-webkit-scrollbar {
width: 0;
}
}

&-right-panel-footer {
height: 39px;
line-height: 34px;
border-left: 1px solid #ccc;
span {
transform: rotate(90deg);
}
}

&-right-panel-header, &-right-panel-footer {
display: flex;
justify-content: center;
cursor: pointer;
color: #999;
font-size: 16px;
span:after {
content: '›';
}
}

table {
border-collapse: collapse;
max-width: 100%;
Expand Down Expand Up @@ -177,25 +243,25 @@
text-align: center;

&:hover {
background: #ebfaff;
background: #fcecd9;
cursor: pointer;
}
}

&-selected-day &-date {
background: tint(#3fc7fa, 80%);
background: tint(#f09f3f, 80%);
}

&-selected-date &-date {
background: #3fc7fa;
background: #f09f3f;
color: #fff;
&:hover {
background: #3fc7fa;
background: #f09f3f;
}
}

&-today &-date {
border: 1px solid #3fc7fa;
border: 1px solid #f09f3f;
}

&-disabled-cell &-date {
Expand Down Expand Up @@ -278,7 +344,7 @@

&:hover {
cursor: pointer;
color: #23c0fa;
color: #f09f4g;
}

&-disabled {
Expand Down
8 changes: 4 additions & 4 deletions assets/index/DecadePanel.less
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

&:hover {
cursor: pointer;
color: #23c0fa;
color: #f09f4g;
}
Comment on lines 35 to 38
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

无效的十六进制颜色值
> a:hover 中使用的 color: #f09f4g 包含非法字符 g,应修正为有效的十六进制值(例如 #f09f3f)。

🤖 Prompt for AI Agents
In assets/index/DecadePanel.less around lines 35 to 38, the color value #f09f4g
used in the :hover selector is invalid due to the character 'g'. Replace this
with a valid hexadecimal color code, such as #f09f3f, to fix the syntax error.

}
}
Expand Down Expand Up @@ -96,17 +96,17 @@
text-align: center;

&:hover {
background: #ebfaff;
background: #fcecd9;
cursor: pointer;
}
}

.@{prefixClass}-decade-panel-selected-cell .@{prefixClass}-decade-panel-decade {
background: #3fc7fa;
background: #f09f3f;
color: #fff;

&:hover {
background: #3fc7fa;
background: #f09f3f;
color: #fff;
}
}
Expand Down
6 changes: 3 additions & 3 deletions assets/index/Input.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
transform: border 0.3s cubic-bezier(0.35, 0, 0.25, 1), background 0.3s cubic-bezier(0.35, 0, 0.25, 1), box-shadow 0.3s cubic-bezier(0.35, 0, 0.25, 1);

&:hover {
border-color: #23c0fa;
border-color: #f09f4g;
}

&:focus {
border-color: #23c0fa;
box-shadow: 0 0 3px #23c0fa;
border-color: #f09f4g;
box-shadow: 0 0 3px #f09f4g;
}
Comment on lines +15 to 21
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

无效的十六进制颜色值
你使用了 #f09f4g,其中字符 g 并不在合法的 0–9/A–F 范围内,CSS 解析会失败。请修正为合法的十六进制值,例如:

-&:hover {
-  border-color: #f09f4g;
-}
+&:hover {
+  border-color: #f09f4f; /* 示例:将最后一位 g 改为合法的 0–F */
+}

-&:focus {
-  border-color: #f09f4g;
-  box-shadow: 0 0 3px #f09f4g;
-}
+&:focus {
+  border-color: #f09f4f;
+  box-shadow: 0 0 3px #f09f4f;
+}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
border-color: #f09f4g;
}
&:focus {
border-color: #23c0fa;
box-shadow: 0 0 3px #23c0fa;
border-color: #f09f4g;
box-shadow: 0 0 3px #f09f4g;
}
&:hover {
border-color: #f09f4f; /* 示例:将最后一位 g 改为合法的 0–F */
}
&:focus {
border-color: #f09f4f;
box-shadow: 0 0 3px #f09f4f;
}
🤖 Prompt for AI Agents
In assets/index/Input.less around lines 15 to 21, the color code #f09f4g is
invalid because 'g' is not a valid hexadecimal character. Replace all instances
of #f09f4g with a valid hex color code, such as #f09f46 or another appropriate
color value within 0-9 and A-F.

}
8 changes: 4 additions & 4 deletions assets/index/MonthPanel.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

&:hover {
cursor: pointer;
color: #23c0fa;
color: #f09f4g;
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

修复无效的十六进制颜色代码

颜色值 #f09f4g 包含无效的十六进制字符 'g'。有效的十六进制颜色代码只能包含 0-9 和 a-f 字符。

应用此修复:

-      color: #f09f4g;
+      color: #f09f3f;
🤖 Prompt for AI Agents
In assets/index/MonthPanel.less at line 41, the color value '#f09f4g' contains
an invalid hexadecimal character 'g'. Replace 'g' with a valid hexadecimal digit
(0-9 or a-f) to correct the color code.

}
}
}
Expand Down Expand Up @@ -111,7 +111,7 @@
text-align: center;

&:hover {
background: #ebfaff;
background: #fcecd9;
cursor: pointer;
}
}
Expand All @@ -129,11 +129,11 @@
}

.@{prefixClass}-month-panel-selected-cell .@{prefixClass}-month-panel-month {
background: #3fc7fa;
background: #f09f3f;
color: #fff;

&:hover {
background: #3fc7fa;
background: #f09f3f;
color: #fff;
}
}
Expand Down
6 changes: 3 additions & 3 deletions assets/index/TimePanel.less
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@
margin: 0 auto;

&:hover {
background: #ebfaff;
background: #fcecd9;
cursor: pointer;
}
}


.@{prefixClass}-time-panel-selected-cell .@{prefixClass}-time-panel-time {
background: #3fc7fa;
background: #f09f3f;
color: #fff;

&:hover {
background: #3fc7fa;
background: #f09f3f;
color: #fff;
}
}
16 changes: 4 additions & 12 deletions assets/index/YearPanel.less
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

&:hover {
cursor: pointer;
color: #23c0fa;
color: #f09f4g;
}
Comment on lines 39 to 42
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

无效的十六进制颜色值
> a:hover 中的 color: #f09f4g 包含非法字符 g,请改为有效值,如 #f09f3f

🤖 Prompt for AI Agents
In assets/index/YearPanel.less around lines 39 to 42, the color value #f09f4g in
the :hover selector contains an invalid hexadecimal character 'g'. Replace this
with a valid hex color code, such as #f09f3f, to fix the invalid color value.

}
}
Expand Down Expand Up @@ -110,25 +110,17 @@
text-align: center;

&:hover {
background: #ebfaff;
background: #fcecd9;
cursor: pointer;
}
}

.@{prefixClass}-year-panel-selected-cell .@{prefixClass}-year-panel-year {
background: #3fc7fa;
background: #f09f3f;
color: #fff;

&:hover {
background: #3fc7fa;
background: #f09f3f;
color: #fff;
}
}

.@{prefixClass}-year-panel-last-decade-cell, .@{prefixClass}-year-panel-next-decade-cell {
.@{prefixClass}-year-panel-year{
user-select: none;
-webkit-user-select: none;
color: rgba(0, 0, 0, 0.25);
}
}
Loading