Arabic site News Listing to show date in Gregorian
News listing plugin on Arabic site is showing publication date in Hijri format. I want it to be in Gregorian. Can anyone help?
Hi Paul. I had the same problem. I just built new extension for ItemViewModel.
public static class ItemViewModelExtension public static string GetDateTimeGregorianCalendar(this ItemViewModel item, string fieldName, string format) var date = (DateTime)item.Fields.GetMemberValue(fieldName); var culture = new CultureInfo(Thread.CurrentThread.CurrentUICulture.Name); GregorianCalendar calendar = new GregorianCalendar(); culture.DateTimeFormat.Calendar = calendar; return date.ToString(format, culture); And in Feather widget template i am using
@item.GetDateTimeGregorianCalendar("PublicationDate", "MMM d, yyyy, HH:mm tt")instead
@item.GetDateTime("PublicationDate", "MMM d, yyyy, HH:mm tt")