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

[ Issue with solution ] in Date-Picker selection type Range demo code #167

Open
PratikVR opened this issue Feb 7, 2025 · 1 comment
Open

Comments

@PratikVR
Copy link

PratikVR commented Feb 7, 2025

The issue :

Note that there should be name of 2 months but it's a single month

image

The solution :

Replace

this

// rest of the code 
<DatePickerContext>
               {(api) => {
                 const offset = createMemo(() => api().getOffset({ months: 1 }))
                 return (
                   <>
                     <DatePickerViewControl>
                       <DatePickerPrevTrigger />
                       <DatePickerViewTrigger>
                         <DatePickerRangeText />
                       </DatePickerViewTrigger>
                       <DatePickerNextTrigger />
                     </DatePickerViewControl> 
                     // rest of the code 

with this

// rest of the code 
<DatePickerContext>
                {(api) => {
                  const offset = createMemo(() => api().getOffset({ months: 1 }))
                  return (
                    <>
                      <DatePickerViewControl>
                       <DatePickerPrevTrigger />
                        <div class="w-full font-medium text-center text-sm">{api().visibleRangeText.start}</div>
                        <div class="w-full font-medium text-center text-sm" >{api().visibleRangeText.end}</div>
                        <DatePickerNextTrigger />
                      </DatePickerViewControl>
                       // rest of the code 
@PratikVR
Copy link
Author

PratikVR commented Feb 7, 2025

any questions ?

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

No branches or pull requests

1 participant