We are building an interactive automation script that is launched via Low Code App (LCA). The app converts all datetimes to local time, which is the desired behaviour throughout the app. However, I need the default value only of two DateTimePicker controls (RequestedResolutionDate and ExpectedResolutionDate) to remain fixed at tomorrow 00:00 regardless of the user's timezone. Has anyone found a way to bypass or override the local time conversion just for a default value without affecting the rest of the app's behaviour?
Current implementation:
public DateTimePicker RequestedResolutionDate { get; } = new DateTimePicker
{
DebugTag = DebugTags.RequestedResolutionDate,
DateTime = DateTime.Today.ToUniversalTime().AddDays(1),
Minimum = DateTime.Today.ToUniversalTime().AddDays(1),
};public DateTimePicker ExpectedResolutionDate { get; } = new DateTimePicker
{
DebugTag = DebugTags.ExpectedResolutionDate,
DateTime = DateTime.Today.ToUniversalTime().AddDays(1),
Minimum = DateTime.Today.ToUniversalTime().AddDays(1),
};
Hey Harun,
I had a similar issue a while ago: IAS - Detect Client TimeZone - DataMiner Dojo.
You can get the Client TimeZone from the DateTimePicker using the ClientDateTime property (Property ClientDateTime | DataMiner Docs) and using that you can find the offset between the server time and the client time and then adjust the time in the background to show the desired time.
Unfortunately, this will require interaction from the User with the UI to determine the Client TimeZone and is only available from DataMiner 10.5.4/10.6.0 onwards so this might not work in this use case.
I hope this helps,
Bauti