- Home
- Forum
- ASP.NET MVC
- 31 days in May
31 days in May
Hello,
@{ViewBag.Title = "ScheduleFeatures";}
<script src="@Url.Content("~/Scripts/ej/cultures/ej.culture.nl-NL.min.js")"></script>
<h2>31 days in May??</h2>
@(Html.EJ().Schedule("Schedule1")
.Width("100%")
.Height("500px")
.CellWidth("40px")
.CellHeight("80px")
.TimeZone("UTC +00:00")
.CurrentDate(new DateTime(2016, 5, 1))
.ShowAllDayRow(false)
.ShowQuickWindow(false)
.Orientation(Orientation.Horizontal)
.Locale("nl-NL") //<== Remove for 31 days or change year 2015 or 2017
.CurrentView(CurrentView.Month)
.AppointmentSettings(fields => fields.Datasource(Model)
.Id("Id")
.Subject("Subject")
.StartTime("StartTime")
.EndTime("EndTime")
.AllDay("AllDay")
.Recurrence("Recurrence")
.RecurrenceRule("RecurrenceRule"))
.StartHour(0)
.EndHour(12)
.AppointmentTemplateId("#MyTemplate")
)
1) Adopted your SceduleFeatures sample.
When using .Locale("nl-NL") th month May only gives 29 days
2) Is it possible to change the background color of appointment(s) in a cell.
Best regards,
Stephen
Regards,
Karthigeyan
.Width("100%")
.Height("500px")
.CellWidth("50px")
.CellHeight("80px")
.TimeZone("UTC +00:00")
.CurrentDate(new DateTime(2016, 1,1))
.ShowAllDayRow(false)
.ShowQuickWindow(false)
.Orientation(Orientation.Horizontal)
.Locale("nl-NL")
.CurrentView(CurrentView.Month)
.CategorizeSettings(fields => fields.Datasource((IEnumerable<Categorize>)ViewBag.catagorize).AllowMultiple(true).Id("Soort").Text("text").Color("color").FontColor("fontColor"))
.Resources(res =>
{
res.Field("PersoonId").Title("Persoon").Name("persoonSource").AllowMultiple(true)
.ResourceSettings(flds => flds.Datasource((IEnumerable<Persoon>)ViewBag.persoonSource).Text("Naam").Id("PersoonId")).Add();
})
.Group(gr =>{gr.Resources(ViewBag.Resources); })
.AppointmentSettings(fields => fields.Datasource(ds => ds.URL("/DienstRooster/GetData").CrudURL("/DienstRooster/Batch").Adaptor("UrlAdaptor"))
.Id("RoosterId")
.Description("Opmerking")
.Subject("Onderwerp")
.StartTime("Start")
.EndTime("Eind")
.AllDay("IsAllDay")
.Recurrence("IsRecurrence")
.RecurrenceRule("RecurrenceRule")
.ResourceFields("PersoonId"))
.ScheduleClientSideEvents(eve => eve.AppointmentWindowOpen("onAppointmentWindowOpen"))
)
{
ViewBag.persoonSource = PersoonSource;
List<Categorize> CategorizeValue = new List<Categorize>();
CategorizeValue.Add(new Categorize { text = "Blue Category", Soort = 0, color = "#43b496", fontColor = "#ffffff" });
CategorizeValue.Add(new Categorize { text = "Green Category", Soort = 100, color = "#7f993e", fontColor = "#ffffff" });
CategorizeValue.Add(new Categorize { text = "Orange Category", Soort = 200, color = "#cc8638", fontColor = "#ffffff" });
resources.Add("persoonSource");
ViewBag.Resources = resources;
ViewBag.categorize = CategorizeValue;
}
{
public string text { set; get; }
public int Soort { set; get; }
public string fontColor { set; get; }
public string color { set; get; }
}
{
public int RoosterId { get; set; }
public int PersoonId { get; set; }
public DateTime Start { get; set; }
public DateTime Eind { get; set; }
public int Soort { get; set; }
-------
}
field "Soort" in the appointment record. Did not realize it had to
be a string. Solved it by having my model returning
- 5 Replies
- 2 Participants
-
SS Stephen Schlette
- Apr 30, 2016 03:37 PM UTC
- May 5, 2016 04:16 AM UTC