public MvcHtmlString HirjiCalendarGroup( bool isRequired, int size, string alternateLabel, string placeHolder, object attrs, object inputAttr, CalendarTypes type, DateRange range) { GroupModel.Label = alternateLabel == null?GetLabel(typeof(T).Name, MemberName) : alternateLabel; GroupModel.Size = size; GroupModel.Attributes = ToAttributeString(attrs); InputModel.PlaceHolder = placeHolder != null ? placeHolder : GroupModel.Label; InputModel.AttributeObject = inputAttr; Validations = Helper.VCollection(); if (type == CalendarTypes.Custom) { Validations.Add(new DateValidator(NgOptions.DateValidationPattern, range)); } else { Validations.Add(new DateValidator(NgOptions.DateValidationPattern, type)); } if (InputModel.AttributeObject == null && range != null) { InputModel.AttributeObject = new { data_date_start_date = range.StartDate, data_date_end_date = range.EndDate } } ; if (isRequired) { Validations.AddRequired(); GroupModel.IsRequired = true; } Validations.SetMember(MemberName, typeof(T).Name); GroupModel.ValidationMessages = Validations.GetMessages(); GroupModel.InputControl = GetInputControl(ComponentNames.HijriCalendarTextBox); return(GetView("Components/ControlGroup", GroupModel)); }