Remove Today option From Scheduler

Hi,

I am trying to make the Today option not visible on the scheduler as for the most part people be using this to schedule on dates in the future and won't be today.

Regards,
Max.

3 Replies

AK Alagumeena Kalaiselvan Syncfusion Team May 18, 2020 12:15 PM UTC

Hi Max, 

Thanks for contacting Syncfusion support. 

We have checked your reported case and you can remove today option from Scheduler by overriding below styles in your sample. Refer the below code for that. 
<SfSchedule TValue="AppointmentData" Height="550px" SelectedDate="@(new DateTime(2020, 1, 9))"> 
    <ScheduleEventSettings DataSource="@DataSource"></ScheduleEventSettings>\ 
</SfSchedule> 
 
@code{ 
    List<AppointmentData> DataSource = new List<AppointmentData> 
{ 
        new AppointmentData { Id = 1, Subject = "Meeting", StartTime = new DateTime(2020, 1, 6, 9, 30, 0) , EndTime = new DateTime(2020, 1, 6, 11, 0, 0), 
        RecurrenceRule = "FREQ=DAILY;INTERVAL=1;COUNT=5" } 
    }; 
    public class AppointmentData 
    { 
        public int Id { get; set; } 
        public string Subject { get; set; } 
        public DateTime StartTime { get; set; } 
        public DateTime EndTime { get; set; } 
        public string RecurrenceRule { get; set; } 
        public Nullable<int> RecurrenceID { get; set; } 
        public string RecurrenceException { get; set; } 
    } 
} 
 
<style>    
    .e-today{ 
        display: none !important;      // To hide Today option 
    } 
</style> 

Kindly try with shared solution and let us know, If you need further assistance. 

Regards 
Alagumeena.K 



TA Tan January 4, 2022 03:09 AM UTC

Hi,

Instead of hiding it, can we make it Today button is really scroll to current date at 1st column position?



SK Satheesh Kumar Balasubramanian Syncfusion Team January 4, 2022 01:48 PM UTC

Hi Tan, 
  
Thanks for your update. 
  
By default, when we click the  Today button it navigates to the current date. If you want to move to the first column position, we suggest you use the ScrollToAsync method to achieve your requirement. 

  
  
Index.razor:  
@code{ 
    DateTime CurrentDate = new DateTime(2020, 2, 14); 
    SfSchedule<AppointmentData> ScheduleObj; 
    public void ScheduleCreated() 
    { 
        DateTime currTime = DateTime.Now; 
        string hours = currTime.Hour < 10 ? '0' + currTime.Hour.ToString() : currTime.Hour.ToString(); 
        string minutes = currTime.Minute.ToString(); 
        string time = hours + ':' + minutes; 
        ScheduleObj.ScrollToAsync(time); 
    } 
} 
  
Kindly try the above sample and let us know if this meets your requirement. 

 
Regards, 
Satheesh Kumar B 


Loader.
Up arrow icon