mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-25 15:25:50 +00:00
修复日期跳转器的问题
This commit is contained in:
@@ -70,6 +70,7 @@
|
|||||||
opacity: 0;
|
opacity: 0;
|
||||||
transform: translateY(-8px);
|
transform: translateY(-8px);
|
||||||
}
|
}
|
||||||
|
|
||||||
to {
|
to {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
@@ -144,6 +145,7 @@
|
|||||||
.calendar-grid {
|
.calendar-grid {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(7, 1fr);
|
grid-template-columns: repeat(7, 1fr);
|
||||||
|
grid-template-rows: auto repeat(6, 32px);
|
||||||
gap: 2px;
|
gap: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,7 +158,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.calendar-day {
|
.calendar-day {
|
||||||
aspect-ratio: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -117,10 +117,10 @@
|
|||||||
.days {
|
.days {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(7, 1fr);
|
grid-template-columns: repeat(7, 1fr);
|
||||||
|
grid-template-rows: repeat(6, 36px);
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
|
|
||||||
.day-cell {
|
.day-cell {
|
||||||
aspect-ratio: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ const JumpToDateDialog: React.FC<JumpToDateDialogProps> = ({
|
|||||||
onSelect,
|
onSelect,
|
||||||
currentDate = new Date()
|
currentDate = new Date()
|
||||||
}) => {
|
}) => {
|
||||||
const [calendarDate, setCalendarDate] = useState(new Date(currentDate))
|
const isValidDate = (d: any) => d instanceof Date && !isNaN(d.getTime())
|
||||||
|
const [calendarDate, setCalendarDate] = useState(isValidDate(currentDate) ? new Date(currentDate) : new Date())
|
||||||
const [selectedDate, setSelectedDate] = useState(new Date(currentDate))
|
const [selectedDate, setSelectedDate] = useState(new Date(currentDate))
|
||||||
|
|
||||||
if (!isOpen) return null
|
if (!isOpen) return null
|
||||||
|
|||||||
@@ -830,8 +830,7 @@
|
|||||||
padding: 28px 32px;
|
padding: 28px 32px;
|
||||||
border-radius: 16px;
|
border-radius: 16px;
|
||||||
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
|
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
|
||||||
min-width: 420px;
|
width: 420px;
|
||||||
max-width: 500px;
|
|
||||||
|
|
||||||
h3 {
|
h3 {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
@@ -977,10 +976,10 @@
|
|||||||
.calendar-days {
|
.calendar-days {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(7, 1fr);
|
grid-template-columns: repeat(7, 1fr);
|
||||||
|
grid-template-rows: repeat(6, 40px);
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
|
|
||||||
.calendar-day {
|
.calendar-day {
|
||||||
aspect-ratio: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
|||||||
@@ -1084,7 +1084,7 @@ function ExportPage() {
|
|||||||
>
|
>
|
||||||
<span className="date-label">开始日期</span>
|
<span className="date-label">开始日期</span>
|
||||||
<span className="date-value">
|
<span className="date-value">
|
||||||
{options.dateRange?.start.toLocaleDateString('zh-CN', {
|
{options.dateRange?.start?.toLocaleDateString('zh-CN', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: '2-digit',
|
month: '2-digit',
|
||||||
day: '2-digit'
|
day: '2-digit'
|
||||||
@@ -1098,7 +1098,7 @@ function ExportPage() {
|
|||||||
>
|
>
|
||||||
<span className="date-label">结束日期</span>
|
<span className="date-label">结束日期</span>
|
||||||
<span className="date-value">
|
<span className="date-value">
|
||||||
{options.dateRange?.end.toLocaleDateString('zh-CN', {
|
{options.dateRange?.end?.toLocaleDateString('zh-CN', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
month: '2-digit',
|
month: '2-digit',
|
||||||
day: '2-digit'
|
day: '2-digit'
|
||||||
@@ -1136,9 +1136,9 @@ function ExportPage() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const currentDate = new Date(calendarDate.getFullYear(), calendarDate.getMonth(), day)
|
const currentDate = new Date(calendarDate.getFullYear(), calendarDate.getMonth(), day)
|
||||||
const isStart = options.dateRange?.start.toDateString() === currentDate.toDateString()
|
const isStart = options.dateRange?.start?.toDateString() === currentDate.toDateString()
|
||||||
const isEnd = options.dateRange?.end.toDateString() === currentDate.toDateString()
|
const isEnd = options.dateRange?.end?.toDateString() === currentDate.toDateString()
|
||||||
const isInRange = options.dateRange && currentDate >= options.dateRange.start && currentDate <= options.dateRange.end
|
const isInRange = options.dateRange?.start && options.dateRange?.end && currentDate >= options.dateRange.start && currentDate <= options.dateRange.end
|
||||||
const today = new Date()
|
const today = new Date()
|
||||||
today.setHours(0, 0, 0, 0)
|
today.setHours(0, 0, 0, 0)
|
||||||
const isFuture = currentDate > today
|
const isFuture = currentDate > today
|
||||||
|
|||||||
Reference in New Issue
Block a user