Current time in scheduler is displayed at wrong place

The scheduler is displaying the current time (and line) at the wrong place in the timeline.
See the attachment. The timezone I use in the scheduler is "Europe/Amsterdam" (same timezone of the webserver and the client).
How to solve this?
And how can I format the current time as Hm instead of hm (just like the times in the timeline)?

Or is it possible to hide the current time (and line)? I tried to hide it with css, but after toggeling the view inside the scheduler the current time (and line) reappear.







Attachment: schedulercurrentime_31440435.zip

3 Replies

VD Vinitha Devi Murugan Syncfusion Team July 5, 2018 05:16 AM UTC

Hi Sietse, 
  
Thanks for contacting Syncfusion support.  
 
Please find the following response for your queries: 
  
Query  #1: The scheduler is displaying the current time (and line) at the wrong place in the timeline. 
We have analyzed the reported scenario based on the given screenshot by preparing a sample, but we are unable to reproduce it at our end. We tried by setting "Europe/Amsterdam" to the system and by changing the time mode of Timescale too. Could you please share us the information on which particular scenario you faced this problem and also if possible, kindly share the code example or reproduce it in our below shared sample and revert us. 
  
Query  #2: How can I format the current time as Hm instead of hm (just like the times in the timeline)?  
 We have prepared the sample to meet your requirement “format the current time as Hm instead of hm” by changing timeFormat property. We have prepared a sample for your reference which can be downloaded from the below link. 

In app.component.ts file 

import { Component, OnInit, ViewChild } from '@angular/core'; 
import { ScheduleComponent, EventSettingsModel, TimeScaleModel, DayService, WeekService, 
  WorkWeekService, MonthService, AgendaService } from '@syncfusion/ej2-ng-schedule'; 
import { Internationalization } from '@syncfusion/ej2-base'; 
 
@Component({ 
    selector: 'my-app', 
    // specifies the template string for the Schedule component 
    template: `<ejs-schedule #schedule width='100%' height='550px'  
  [selectedDate]="selectedDate" [eventSettings]="eventSettings" [timeScale]="timeScale" 
  (dataBinding)="onDataBinding()"> 
     <ng-template #timeScaleMajorSlotTemplate let-data> 
        <div class="majorTime">{{getMajorTime(data.date)}}</div> 
    </ng-template> 
    <ng-template #timeScaleMinorSlotTemplate let-data> 
        <div class="minorTime">{{getMinorTime(data.date)}}</div> 
    </ng-template> 
</ejs-schedule>` 
}) 
export class AppComponent implements OnInit { 
    public selectedDate: Date; 
    public timeScale: TimeScaleModel; 
    public instance: Internationalization = new Internationalization(); 
    public timezone: string; 
    @ViewChild('schedule') 
    public scheduleObj: ScheduleComponent; 
    ngOnInit(): void { 
        this.selectedDate = new Date(2018, 1, 15); 
    this.timeScale = { enable: true, interval: 60, slotCount: 4 }; 
} 
getMajorTime(date: Date): string { 
    return this.instance.formatDate(date, { skeleton: 'Hm' }); 
} 
getMinorTime(date: Date): string { 
    return this.instance.formatDate(date, { skeleton: 'ms' }).replace(':00', ''); 
} 
onDataBinding(): void { 
    this.scheduleObj.timeFormat = "H:mm"; 
} 
} 
 
Query #3: Is it possible to hide the current time
 
Yes, it is possible to hide current time indicator by setting showTimeIndicator property to false. Please refer the below code. 
<Code> 
@Component({ 
    selector: 'my-app', 
    // specifies the template string for the Schedule component 
    template: `<ejs-schedule #schedule width='100%' height='550px'  
  [selectedDate]="selectedDate" [eventSettings]="eventSettings" [timeScale]="timeScale" 
  showTimeIndicator = false > 
     <ng-template #timeScaleMajorSlotTemplate let-data> 
        <div class="majorTime">{{getMajorTime(data.date)}}</div> 
    </ng-template> 
    <ng-template #timeScaleMinorSlotTemplate let-data> 
        <div class="minorTime">{{getMinorTime(data.date)}}</div> 
    </ng-template> 
</ejs-schedule>` 
}) 
</Code> 
 

Regards, 
M. Vinitha devi 



KK kavya kasam August 5, 2022 05:30 AM UTC


I want to add red lines indicator for different timeslots which are taken as list (dynamically).Example 1:00pm,7:00 pm,9:00 am.etc.Is that possible?



SK Satheesh Kumar Balasubramanian Syncfusion Team August 8, 2022 12:49 PM UTC

Hi Kavya,

 

Currently, We don’t have direct property option to achieve your requirement. But, you can form the indicator element and position the element based on your requirement in sample end.

 

Regards,

Satheesh Kumar B


Loader.
Up arrow icon