Method GetClientDateTime
- Namespace
- Skyline.DataMiner.Automation
- Assembly
- SLManagedAutomation.dll
GetClientDateTime(string)
Gets the date/time that was selected for the specified destination variable, as displayed in the client, which is linked to a Calendar and Time item. If the client date/time is not available, e.g. when ClientTimeInfo is set to Disabled, the returned value will be MinValue.
public DateTimeOffset GetClientDateTime(string key)
Parameters
key
stringThe name of the destination variable.
Returns
- DateTimeOffset
The date/time that was selected for the specified destination variable, as displayed in the client, which is linked to a Calendar and Time item.
Examples
var selection = DateTime.Now;
...
var blockCalendar = new UIBlockDefinition
{
Type = UIBlockType.Calendar,
InitialValue = selection.ToString(AutomationConfigOptions.GlobalDateTimeFormat),
DestVar = "calendar",
WantsOnChange = true,
ClientTimeInfo = UIClientTimeInfo.Return,
};
uib.AppendBlock(blockCalendar);
...
var uir = engine.ShowUI(uib);
...
var clientDateTime = uir.GetClientDateTime(blockCalendar.DestVar);
var displayedDateTime = clientDateTime.DateTime;