@model SyncfusionMvcApplicationCrud.Models.ScheduleModel @{ ViewBag.Title = "ScheduleFeatures"; } <h2>ScheduleFeatures</h2> <div> @(Html.EJ().Schedule("Schedule") .Width("100%") .Height("525px") .TimeZone("UTC +00:00") .TimeMode(Syncfusion.JavaScript.TimeMode.Hour24) .CurrentDate(DateTime.Now) .ShowCurrentTimeIndicator() .Views(new List<string>() { "Week" }) .ShowQuickWindow(true) .AppointmentSettings( fields => fields.Datasource((IEnumerable<SyncfusionMvcApplicationCrud.Models.DefaultSchedule>)Model.Appointments) .Id("Id") .Subject("Subject") .Description("Description") .StartTime("StartTime") .EndTime("EndTime") .AllDay("AllDay") .Recurrence("Recurrence") .RecurrenceRule("RecurrenceRule")) .ScheduleClientSideEvents(e => e.Create("onCreate") ) .DateFormat("ddd dd/mm/yyyy") ) </div> <script type="text/javascript"> function onCreate(args) { debugger; this._dataManager.dataSource.crudUrl = "/Schedule/Batch"; } </script>
public JsonResult Batch(EditParams param)
$("#Schedule1").ejSchedule({ width: "100%", height: "500px",
@(Html.EJ().Schedule("Schedule1")
.Width("100%")
.Height("525px")
.AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/Schedule/GetData").CrudURL("/Schedule/Batch").Adaptor(AdaptorType.UrlAdaptor))
.Id("Id")
.Subject("Subject")
.StartTime("StartTime")
.EndTime("EndTime")
.Description("Description")
.AllDay("AllDay")
.Recurrence("Recurrence")
.RecurrenceRule("RecurrenceRule"))
)
</code>
Query #2: Date Format in Schedule
We have analyzed the reported scenario with the provided code snippets and found that the necessary dateformat was wrongly passed. Therefore, we suggest you to pass the date format properly to apply the given dateformat to the Syncfusion Controls. Please find the following code snippet to know about how to pass the date format to the Schedule control.
<code>
@(Html.EJ().Schedule("Schedule1")
.Width("100%")
.Height("525px")
.DateFormat("ddd dd/MM/yyyy") // Here we need to mention the dateformat string with proper cases to apply date format properly (ex: MM for month instead of mm))
</code>
We have prepared the sample with the above code snippets that can be downloaded from the following location.
http://www.syncfusion.com/downloads/support/forum/120003/ze/SampleScheduleCRUD1148312314
Please let us know if you need further assistance on this.
Regards,
Velmurugan
@(Html.EJ().Schedule("Schedule1")
.Width("100%")
.Height("525px")
.TimeZone("UTC +00:00")
.TimeMode(Syncfusion.JavaScript.TimeMode.Hour24)
.CurrentDate(DateTime.Now)
.ShowCurrentTimeIndicator()
.Views(new List<string>() { "Week" })
.ShowQuickWindow(true)
.AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/Schedule/GetData").CrudURL("/Schedule/Batch").Adaptor(AdaptorType.UrlAdaptor))
.Id("Id")
.Subject("Subject")
.StartTime("StartTime")
.EndTime("EndTime")
.Description("Description")
.AllDay("AllDay")
.Recurrence("Recurrence")
.RecurrenceRule("RecurrenceRule"))
.DateFormat("ddd dd/MM/yyyy") // Here we need to mention the with proper cases to apply date format properly (ex: MM for month instead of mm)
.ScheduleClientSideEvents(evt =>evt.Create("onCreate").ActionComplete("onCreate"))
)
<script>
function onCreate() { // The following code snippet is used to display the column header date in specified format
var obj = $("#Schedule1").data("ejSchedule");
if (obj.currentView() != "month") {
for (var i = 0; i < obj.dateRender.length; i++) {
var temp = Globalize.format(new Date(obj.dateRender[i]), obj.model.dateFormat);
obj.element.find(".e-headerdaydisplay")[i].innerHTML = temp;
}
}
}
</script>
</code>
We have modified the sample with the above code snippets, which can be downloaded from the following location.
http://www.syncfusion.com/downloads/support/forum/120003/ze/SampleScheduleCRUD1562197851
Please let us know if it helps and if you need any further assistance on this.
Regards,
Velmurugan