How change color react-date-range (solved)

I use dependency react-date-range I want change color to red (for example) how I can achieve it? https://codesandbox.io/p/sandbox/ecstatic-cohen-pmw79g?file=%2F.gitignore%3A1%2C1 SOLUTION: add color={'red'}
<div className='flex justify-center items-center'>
<div className='calendarWrap' ref={dropdownRef}>
<input className='inputBox outline-none' value={calendar} readOnly onClick={() => setOpen(open => !open)} />
<Calendar className={`calendarElement ${open ? 'dropdown-calendar-active' : 'dropdown-calendar-inactive'}`}
onChange={handleSelect} color={'red'} date={new Date()} />
</div>
</div>
<div className='flex justify-center items-center'>
<div className='calendarWrap' ref={dropdownRef}>
<input className='inputBox outline-none' value={calendar} readOnly onClick={() => setOpen(open => !open)} />
<Calendar className={`calendarElement ${open ? 'dropdown-calendar-active' : 'dropdown-calendar-inactive'}`}
onChange={handleSelect} color={'red'} date={new Date()} />
</div>
</div>
16 Replies
Jochem
Jochem2y ago
the various color options in the documentation don't do what you want? https://www.npmjs.com/package/react-date-range
npm
react-date-range
A React component for choosing dates and date ranges.. Latest version: 1.4.0, last published: 2 years ago. Start using react-date-range in your project by running npm i react-date-range. There are 326 other projects in the npm registry using react-date-range.
Jochem
Jochem2y ago
The default values for rangeColors seem to match the RGB values in your screenshot, and the color seems to be the same as well: https://github.com/hypeserver/react-date-range/blob/master/src/components/DateRange/index.js line 153 So all you'd have to do is use that rangeColors option like described in the docs for the package you're using
Nikita
NikitaOP2y ago
Nikita
NikitaOP2y ago
Nikita
NikitaOP2y ago
Nikita
NikitaOP2y ago
Just send me what to do instead docs all docs without pictues are hard
Nikita
NikitaOP2y ago
Jochem
Jochem2y ago
I think that, but try with three values, and if that doesn't work try with three hexadecimal values instead of named colors
Nikita
NikitaOP2y ago
with 3 values doesn't work - red its only for example - in my project i use HEX e.g #202020
Jochem
Jochem2y ago
how did you use the three values?
Nikita
NikitaOP2y ago
why you want know this? I think now its doesn't matter
Nikita
NikitaOP2y ago
Jochem
Jochem2y ago
I'm very confused, did you fix it somehow?
Nikita
NikitaOP2y ago
yes
Nikita
NikitaOP2y ago
SOLUTION
Nikita
NikitaOP2y ago
I added color={'red'}
Want results from more Discord servers?
Add your server