we are using below code to display dateTime calendar in CMS Edit mode.
[EditorDescriptorRegistration(TargetType = typeof(DateTime?), UIHint = "Datepicker")]
[EditorDescriptorRegistration(TargetType = typeof(DateTime), UIHint = "Datepicker")]
public class DateSelectorEditorDescriptor : EditorDescriptor
public override void ModifyMetadata(ExtendedMetadata metadata, IEnumerable attributes)
ClientEditingClass = "dijit/form/DateTextBox";
This is working fine on local system when i am seleting date from Edit mode but when we are deploying this code on upper environment then date is coming as last day date. For example, if i select date as 18-jan-2018 from EditMode but system is treating this date as 17-Jan-2018.
Is this only happening with EditorDescriptionRegistration? Have you checked any other datetime properties rendered on the page? It sounds like it could be a confusion around timezones, since the time on the server doesn't have to be the same as on the client and the CMS UI will display the time in the timezone of the browser the editor is using - which doesn't have to be the same as what the server will render for a visitor on the site.
You might want to check out this thread as well: https://world.episerver.com/forum/developer-forum/-Episerver-75-CMS/Thread-Container/2015/2/datetime-utc-offset/
I checked for other datetime properties and they are working fine on server. It is not about timezone of server, i already verified that. However for my solution, i used other datetime property but wanted to know why it is not working with EditorDescriptionRegistration.
Thanks for your response.
Good that it works for you. We havent seen it before and i tried to reproduce the problem but cant find anything for now
I am facing the same issue. Can you please eloborate like how you fixed this?