We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

[DateRangePickerComponent] cssClass property not working in Next.js?

Thread ID:

Created:

Updated:

Platform:

Replies:

143557 Mar 26,2019 05:49 PM UTC Mar 28,2019 04:37 AM UTC React - EJ 2 3
loading
Tags: DateRangePicker
Néstor Llamas Llopis
Asked On March 26, 2019 05:49 PM UTC

Hello,

I am having problems with DateRangePickerComponent. I am able to override styles through the property cssClass with create-react-app environment, but not with Next.js environment. So maybe is not compatible this feature with Next.js, or does it have nothing to do with this?

Regards,
Néstor Llamas Llopis


Deepa Loganathan [Syncfusion]
Replied On March 27, 2019 12:50 PM UTC

 
Hi Néstor, 
 
We have tested our component with NextJS to override the styles of Daterangepicker cssClass and was able to override the styles as expected. So please ensure if there is any spell error in the cssClass name used in your sample. 
 
For your reference, we have attached the test sample in the below link. 
 
 
Here, we have customized the color of the week end dates in DateRangePicker popup as given in the below code.  
 
[INDEX.JS] 
 
 
import { render } from 'react-dom'; 
import * as React from 'react'; 
import { DateRangePickerComponent } from '@syncfusion/ej2-react-calendars'; 
 
export class Default extends React.Component { 
    render() { 
        return ( 
        <div className='control-pane'> 
                <div className='control-section'> 
                    <div className='daterangepicker-control-section'> 
                    <DateRangePickerComponent cssClass='customCSS' width="500px"></DateRangePickerComponent> 
                    </div> 
                </div>  
                 <link rel='nofollow' href="https://cdn.syncfusion.com/ej2/material.css" rel="stylesheet" /> 
                 <style jsx global>{` 
                 .customCSS .e-calendar .e-content .e-weekend span {  
                 color: red; 
                 } 
                 `}</style> 
            </div> 
             
            ); 
    } 
} 
 
export default Default; 
 
 
 
Note: Please download the sample from the above link and run “npm install” command to install the required packages and run “npm run dev” command to launch the application in browser. 
 
To know more about cssClass, please refer the below documentation link. 
 
 
If you are still facing issues in customizing Daterangepicker, please revert with issue reproducing sample that will help us to check and isolate the root cause of the issue and provide a prompt solution soon. 
 
Regards, 
Deepa L. 
 


Néstor Llamas Llopis
Replied On March 27, 2019 03:43 PM UTC

OK, I've seen my error. I was declaring <style jsx> instead of <style jsx global>, so the styles couldn't be passed to DateRangePickerComponent as the scope was local, not global.

Deepa Loganathan [Syncfusion]
Replied On March 28, 2019 04:37 AM UTC

Hi Néstor,  

We are glad to hear that the issue was resolved. Please let us know if you would require any further assistance.  

Regards,  
Deepa L. 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon