Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 3 additions & 4 deletions src/packages/calendar/demos/h5/demo10.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function getDay(i: number): string {
}

const Demo10 = () => {
const [date, setDate] = useState<string[]>(['2023-07-10', '2023-07-19'])
const [date, setDate] = useState<string[]>(['2024-07-10', '2024-07-19'])

const [isVisible, setIsVisible] = useState(false)

Expand All @@ -73,7 +73,7 @@ const Demo10 = () => {

const goDate = () => {
if (calendarRef.current) {
calendarRef.current.scrollToDate('2023-04-01')
calendarRef.current.scrollToDate('2024-10-01')
}
}

Expand Down Expand Up @@ -135,8 +135,7 @@ const Demo10 = () => {
visible={isVisible}
defaultValue={date}
type="range"
startDate="2022-12-22"
endDate="2024-12-31"
startDate="2023-12-22"
renderHeaderButtons={renderHeaderButtons}
onClose={closeSwitch}
onConfirm={setChooseValue}
Expand Down
6 changes: 3 additions & 3 deletions src/packages/calendar/demos/h5/demo11.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react'
import { Calendar } from '@nutui/nutui-react'

const Demo11 = () => {
const [date, setDate] = useState<string[]>(['2023-06-03', '2023-06-16'])
const [date, setDate] = useState<string[]>(['2025-06-03', '2025-06-16'])

const setChooseValue = (param: string) => {
setDate([...[param[0][3], param[1][3]]])
Expand All @@ -27,8 +27,8 @@ const Demo11 = () => {
popup={false}
defaultValue={date}
type="range"
startDate="2023-5-23"
endDate="2023-08-01"
startDate="2025-02-23"
endDate="2025-08-01"
startText={<div>test</div>}
endText="leave"
autoBackfill
Expand Down
6 changes: 3 additions & 3 deletions src/packages/calendar/demos/h5/demo2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react'
import { Cell, Calendar } from '@nutui/nutui-react'

const Demo2 = () => {
const [date, setDate] = useState(['2023-01-23', '2023-11-26'])
const [date, setDate] = useState(['2025-01-23', '2025-03-26'])
const [isVisible, setIsVisible] = useState(false)

const openSwitch = () => {
Expand Down Expand Up @@ -33,8 +33,8 @@ const Demo2 = () => {
visible={isVisible}
defaultValue={date}
type="range"
startDate="2022-12-22"
endDate="2024-01-08"
startDate="2024-12-22"
endDate="2026-01-08"
onClose={closeSwitch}
onConfirm={setChooseValue}
onDayClick={select}
Expand Down
4 changes: 2 additions & 2 deletions src/packages/calendar/demos/h5/demo3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const Demo3 = () => {
visible={isVisible}
defaultValue={date}
type="multiple"
startDate="2023-01-01"
endDate="2024-09-10"
startDate="2025-01-01"
endDate="2026-09-10"
onClose={closeSwitch}
onConfirm={setChooseValue}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/packages/calendar/demos/h5/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const Demo4 = () => {
visible={isVisible}
defaultValue={date}
type="week"
startDate="2023-01-01"
endDate="2024-09-10"
startDate="2025-01-01"
endDate="2026-09-10"
firstDayOfWeek={1}
onClose={closeSwitch}
onConfirm={setChooseValue}
Expand Down
4 changes: 2 additions & 2 deletions src/packages/calendar/demos/h5/demo5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const Demo5 = () => {
visible={isVisible}
defaultValue={date}
type="week"
startDate="2023-01-01"
endDate="2024-09-10"
startDate="2025-01-01"
endDate="2026-09-10"
disableDate={disableDate}
firstDayOfWeek={1}
onClose={closeSwitch}
Expand Down
4 changes: 2 additions & 2 deletions src/packages/calendar/demos/h5/demo6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ const Demo6 = () => {
visible={isVisible}
defaultValue={date}
type="range"
startDate="2023-01-01"
endDate="2024-09-10"
startDate="2024-01-01"
endDate="2025-09-10"
disableDate={disableDate}
firstDayOfWeek={1}
onDayClick={(date) => {
Expand Down
2 changes: 0 additions & 2 deletions src/packages/calendar/demos/h5/demo7.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const Demo7 = () => {
<Calendar
visible={isVisible}
defaultValue={date}
startDate=""
endDate=""
autoBackfill
onClose={closeSwitch}
onConfirm={setChooseValue}
Expand Down
6 changes: 3 additions & 3 deletions src/packages/calendar/demos/h5/demo8.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react'
import { Cell, Calendar } from '@nutui/nutui-react'

const Demo8 = () => {
const [date, setDate] = useState<string[]>(['2023-03-23', '2023-11-26'])
const [date, setDate] = useState<string[]>(['2025-03-23', '2025-05-26'])
const [isVisible, setIsVisible] = useState(false)

const openSwitch = () => {
Expand Down Expand Up @@ -33,8 +33,8 @@ const Demo8 = () => {
defaultValue={date}
type="range"
autoBackfill
startDate="2022-12-22"
endDate="2024-01-08"
startDate="2024-12-22"
endDate="2026-01-08"
onClose={closeSwitch}
onConfirm={setChooseValue}
onDayClick={select}
Expand Down
6 changes: 3 additions & 3 deletions src/packages/calendar/demos/h5/demo9.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const padZero = (num: number | string, targetLength = 2) => {
}

const Demo9 = () => {
const [date, setDate] = useState<string[]>(['2023-06-12', '2023-06-16'])
const [date, setDate] = useState<string[]>(['2024-06-12', '2024-06-16'])

const [isVisible, setIsVisible] = useState(false)

Expand Down Expand Up @@ -57,8 +57,8 @@ const Demo9 = () => {
visible={isVisible}
defaultValue={date}
type="range"
startDate="2023-2-22"
endDate="2024-01-08"
startDate="2024-2-22"
endDate="2025-01-08"
confirmText="submit"
startText="enter"
endText="leave"
Expand Down
10 changes: 6 additions & 4 deletions src/packages/calendar/demos/taro/demo10.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function getDay(i: number): string {
}

const Demo10 = () => {
const [date, setDate] = useState<string[]>(['2023-07-10', '2023-07-19'])
const [date, setDate] = useState<string[]>(['2024-07-10', '2024-07-19'])

const [isVisible, setIsVisible] = useState(false)

Expand All @@ -72,8 +72,11 @@ const Demo10 = () => {
}

const goDate = () => {
// setDate(['2024-10-01', '2024-10-01'])
// 该行用于京东小程序IDE下问题的修复。
// 京东小程序,真机可不需要。
if (calendarRef.current) {
calendarRef.current.scrollToDate('2023-04-01')
calendarRef.current.scrollToDate('2024-10-01')
}
}

Expand Down Expand Up @@ -132,8 +135,7 @@ const Demo10 = () => {
visible={isVisible}
defaultValue={date}
type="range"
startDate="2022-12-22"
endDate="2024-12-31"
startDate="2023-12-22"
renderHeaderButtons={renderHeaderButtons}
onClose={closeSwitch}
onConfirm={setChooseValue}
Expand Down
6 changes: 3 additions & 3 deletions src/packages/calendar/demos/taro/demo11.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react'
import { Calendar } from '@nutui/nutui-react-taro'

const Demo11 = () => {
const [date, setDate] = useState<string[]>(['2023-06-03', '2023-06-16'])
const [date, setDate] = useState<string[]>(['2025-06-03', '2025-06-16'])

const setChooseValue = (param: string) => {
setDate([...[param[0][3], param[1][3]]])
Expand All @@ -27,8 +27,8 @@ const Demo11 = () => {
popup={false}
defaultValue={date}
type="range"
startDate="2023-5-23"
endDate="2023-08-01"
startDate="2025-02-23"
endDate="2025-08-01"
startText={<div>test</div>}
endText="leave"
autoBackfill
Expand Down
6 changes: 3 additions & 3 deletions src/packages/calendar/demos/taro/demo2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react'
import { Cell, Calendar } from '@nutui/nutui-react-taro'

const Demo2 = () => {
const [date, setDate] = useState(['2023-01-23', '2023-11-26'])
const [date, setDate] = useState(['2025-01-23', '2025-03-26'])
const [isVisible, setIsVisible] = useState(false)

const openSwitch = () => {
Expand Down Expand Up @@ -33,8 +33,8 @@ const Demo2 = () => {
visible={isVisible}
defaultValue={date}
type="range"
startDate="2022-12-22"
endDate="2024-01-08"
startDate="2024-12-22"
endDate="2026-01-08"
onClose={closeSwitch}
onConfirm={setChooseValue}
onDayClick={select}
Expand Down
4 changes: 2 additions & 2 deletions src/packages/calendar/demos/taro/demo3.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const Demo3 = () => {
visible={isVisible}
defaultValue={date}
type="multiple"
startDate="2023-01-01"
endDate="2024-09-10"
startDate="2025-01-01"
endDate="2026-09-10"
onClose={closeSwitch}
onConfirm={setChooseValue}
/>
Expand Down
4 changes: 2 additions & 2 deletions src/packages/calendar/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const Demo4 = () => {
visible={isVisible}
defaultValue={date}
type="week"
startDate="2023-01-01"
endDate="2024-09-10"
startDate="2025-01-01"
endDate="2026-09-10"
firstDayOfWeek={1}
onClose={closeSwitch}
onConfirm={setChooseValue}
Expand Down
4 changes: 2 additions & 2 deletions src/packages/calendar/demos/taro/demo5.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ const Demo5 = () => {
visible={isVisible}
defaultValue={date}
type="week"
startDate="2023-01-01"
endDate="2024-09-10"
startDate="2025-01-01"
endDate="2026-09-10"
disableDate={disableDate}
firstDayOfWeek={1}
onClose={closeSwitch}
Expand Down
4 changes: 2 additions & 2 deletions src/packages/calendar/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ const Demo6 = () => {
visible={isVisible}
defaultValue={date}
type="range"
startDate="2023-01-01"
endDate="2024-09-10"
startDate="2024-01-01"
endDate="2025-09-10"
disableDate={disableDate}
firstDayOfWeek={1}
onDayClick={(date) => {
Expand Down
2 changes: 0 additions & 2 deletions src/packages/calendar/demos/taro/demo7.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ const Demo7 = () => {
<Calendar
visible={isVisible}
defaultValue={date}
startDate=""
endDate=""
autoBackfill
onClose={closeSwitch}
onConfirm={setChooseValue}
Expand Down
6 changes: 3 additions & 3 deletions src/packages/calendar/demos/taro/demo8.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useState } from 'react'
import { Cell, Calendar } from '@nutui/nutui-react-taro'

const Demo8 = () => {
const [date, setDate] = useState<string[]>(['2023-03-23', '2023-11-26'])
const [date, setDate] = useState<string[]>(['2025-03-23', '2025-05-26'])
const [isVisible, setIsVisible] = useState(false)

const openSwitch = () => {
Expand Down Expand Up @@ -33,8 +33,8 @@ const Demo8 = () => {
defaultValue={date}
type="range"
autoBackfill
startDate="2022-12-22"
endDate="2024-01-08"
startDate="2024-12-22"
endDate="2026-01-08"
onClose={closeSwitch}
onConfirm={setChooseValue}
onDayClick={select}
Expand Down
6 changes: 3 additions & 3 deletions src/packages/calendar/demos/taro/demo9.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const padZero = (num: number | string, targetLength = 2) => {
}

const Demo9 = () => {
const [date, setDate] = useState<string[]>(['2023-06-12', '2023-06-16'])
const [date, setDate] = useState<string[]>(['2024-06-12', '2024-06-16'])

const [isVisible, setIsVisible] = useState(false)

Expand Down Expand Up @@ -57,8 +57,8 @@ const Demo9 = () => {
visible={isVisible}
defaultValue={date}
type="range"
startDate="2023-2-22"
endDate="2024-01-08"
startDate="2024-2-22"
endDate="2025-01-08"
confirmText="submit"
startText="enter"
endText="leave"
Expand Down
Loading