You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to make the calendar component occupy the entire screen
Code
import{DayPicker}from"react-day-picker";<DayPickermode="single"locale={zhCN}defaultMonth={selected}disabled={beforeMatcher}startMonth={dayjs().set('year',2015).set('month',0).toDate()}endMonth={newDate()}selected={selected}onSelect={setSelected}footer={selected ? (<divclassName="flex justify-between items-center px-4"><div>选择的日期:{selected.toLocaleDateString()}</div><divclassName="px-8 bg-[#1471E3] text-white py-2 rounded-2xl"onClick={()=>{change?.(dateType,selected)setPopupOpen(false)}}>
确认
</div></div>) : (<div>请选择日期</div>)}classNames={{today: `text-[#1471E3]`,// Add a border to today's dateselected: `bg-[#1471E3] border-[#1471E3] text-white rounded-2xl`,// Highlight the selected dayroot: `${defaultClassNames.root} shadow-lg p-5`,// Add a shadow to the root elementchevron: `${defaultClassNames.chevron} fill-[#1471E3]`,// Change the color of the chevron}}/>
Expected Behavior
I hope to be able to set the width of the calendar component, and I can control the style of the entire component (such as width, position, etc.) through CSS
Actual Behavior
At present, the overall width of the component is fixed, and the position of the component is not centered based on the box display
This discussion was converted from issue #2565 on November 01, 2024 15:24.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How to make the calendar component occupy the entire screen
Code
Expected Behavior
I hope to be able to set the width of the calendar component, and I can control the style of the entire component (such as width, position, etc.) through CSS
Actual Behavior
At present, the overall width of the component is fixed, and the position of the component is not centered based on the box display
Screenshots
Beta Was this translation helpful? Give feedback.
All reactions