public IEnterspeedProperty Convert(Item item, Field field, EnterspeedSiteInfo siteInfo, List <IEnterspeedFieldValueConverter> fieldValueConverters) { DateField dateField = field; if (dateField == null || dateField.DateTime == DateTime.MinValue) { return(null); } return(new StringEnterspeedProperty(_fieldService.GetFieldName(field), _dateFormatter.FormatDate(dateField.DateTime))); }
private IEnterspeedProperty CreateMetaData(Item item) { int level = GetContentPathIds(item).IndexOf(item.ID.Guid); var metaData = new Dictionary <string, IEnterspeedProperty> { ["name"] = new StringEnterspeedProperty("name", item.Name), ["displayName"] = new StringEnterspeedProperty("displayName", item.DisplayName), ["language"] = new StringEnterspeedProperty("language", item.Language.Name), ["sortOrder"] = new NumberEnterspeedProperty("sortOrder", item.Appearance.Sortorder), ["level"] = new NumberEnterspeedProperty("level", level), ["createDate"] = new StringEnterspeedProperty("createDate", _dateFormatter.FormatDate(item.Statistics.Created)), ["updateDate"] = new StringEnterspeedProperty("updateDate", _dateFormatter.FormatDate(item.Statistics.Updated)), ["updatedBy"] = new StringEnterspeedProperty("updatedBy", item.Statistics.UpdatedBy), ["fullPath"] = new ArrayEnterspeedProperty("fullPath", GetItemFullPath(item)), ["languages"] = new ArrayEnterspeedProperty("languages", GetAvailableLanguagesOfItem(item)), ["isAccessRestricted"] = GetIsAccessRestricted(item), ["accessRestrictions"] = GetAccessRestrictions(item) }; return(new ObjectEnterspeedProperty(MetaData, metaData)); }