It's possible to change hour into custom text in TimeSlot?

Hi,

It's possible to change hour into custom text in TimeSlot like exemple :

For 4 periods (0-6/6-12/12-18/18-24) into (Night-Morning-Afternoon-Evening)

TimeSlotViewSettings(
timeInterval: Duration(hours: 6),
startHour: 0,
endHour: 24,
timeFormat: customPeriods(date?)

I try this : 

customPeriods(DateTime? date){
print(date);
if(date?.hour == 0){
return "Nuit";
}
if(date?.hour == 6){
return "Matin";
}
if(date?.hour == 12){
return "";
}
if(date?.hour == 18){
return "Soir";
}
}

But I don't know how to get the date/date.hour of the view...

Thanks




3 Replies

IR Indumathi Ravichandran Syncfusion Team October 26, 2021 12:32 PM UTC

Hi Marc, 
 
Thank you for contacting Syncfusion support. 
 
Regarding Query: It's possible to change hour into custom text in TimeSlot?  
 
Yes, it is possible to change hour into custom text, but as per the calendar implementation it is not possible to set the custom text for each hour in the Time slots. Also, we have a KB document for customizing the time labels in the Flutter Calendar. Please find the KB documentation from the following link. 
 
 
We hope that this helps you. Please let us know if you need further assistance. 
 
Regards, 
Indumathi R 



MA Marc Albert Lortscher October 26, 2021 04:07 PM UTC

Unfortunately I have already looked everywhere ...


I have the same operation of my scheduler on Angular and there was a solution.

I wondered if it wasn't adaptive to flutter?


Thanks


Can we modify the render, here is an example in my Angular App:

<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>

getMajorTime(date: Date): string {
if(date.getHours() == 0){
return "Nuit"
}
if(date.getHours() == 6){
return "Matin"
}
if(date.getHours() == 12){
return "A-Midi"
}
if(date.getHours() == 18){
return "Soir"
}
}


IR Indumathi Ravichandran Syncfusion Team October 27, 2021 12:01 PM UTC

Hi Marc, 
 
Thank you for the update. 
 
We have considered your requirement as a feature request for “Providing a builder support for time ruler in the Flutter Calendar (SfCalendar)”. We will implement this feature in any of our upcoming releases.  
 
At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then. 
  
Thank you for requesting this feature. We are always trying to make our products better and feature requests like you are a key part of our product growth efforts. 
  
You can also communicate with us regarding the open features at any time using this Feature Report page.  
 
   
If you have any more specification/suggestions to the feature request, you can add it as a comment in the portal and cast your vote to make it count. 
 
Regards, 
Indumathi R 


Loader.
Up arrow icon