From dfc1f5f996a33fb6ca0b89b622b52d4dfdc157d9 Mon Sep 17 00:00:00 2001 From: "Aaron (Qilong)" <173288704@qq.com> Date: Thu, 3 Nov 2022 07:55:28 -0700 Subject: [PATCH] Update Datetime node info (#13460) --- src/DynamoCore/Graph/Nodes/NodeInputData.cs | 6 ++--- .../CoreNodeModels/Input/DateTime.cs | 5 +++- .../Properties/Resources.Designer.cs | 4 +-- .../Properties/Resources.en-US.resx | 6 ++--- .../CoreNodeModels/Properties/Resources.resx | 6 ++--- .../StringToDateTimeOffsetConverter.cs | 27 ++++++++++++++++--- 6 files changed, 38 insertions(+), 16 deletions(-) diff --git a/src/DynamoCore/Graph/Nodes/NodeInputData.cs b/src/DynamoCore/Graph/Nodes/NodeInputData.cs index 8b3ae4f0825..a0a4dfb8e71 100644 --- a/src/DynamoCore/Graph/Nodes/NodeInputData.cs +++ b/src/DynamoCore/Graph/Nodes/NodeInputData.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using System.Runtime.Serialization; @@ -157,12 +157,12 @@ public override bool Equals(object obj) { var converted = obj as NodeInputData; - var valNumberComparison = false; + bool valNumberComparison; try { valNumberComparison = Math.Abs(Convert.ToDouble(this.Value, CultureInfo.InvariantCulture) - Convert.ToDouble(converted.Value, CultureInfo.InvariantCulture)) < .000001; } - catch (Exception e) + catch (Exception) { //this just stays false. valNumberComparison = false; diff --git a/src/Libraries/CoreNodeModels/Input/DateTime.cs b/src/Libraries/CoreNodeModels/Input/DateTime.cs index a8f061e5e2e..fdb059e2774 100644 --- a/src/Libraries/CoreNodeModels/Input/DateTime.cs +++ b/src/Libraries/CoreNodeModels/Input/DateTime.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Globalization; using Dynamo.Configuration; @@ -23,6 +23,9 @@ private DateTime(IEnumerable inPorts, IEnumerable outPorts ShouldDisplayPreviewCore = false; } + /// + /// Constructor + /// public DateTime() { Value = System.DateTime.UtcNow; diff --git a/src/Libraries/CoreNodeModels/Properties/Resources.Designer.cs b/src/Libraries/CoreNodeModels/Properties/Resources.Designer.cs index 1a88147ae87..fa5002249b7 100644 --- a/src/Libraries/CoreNodeModels/Properties/Resources.Designer.cs +++ b/src/Libraries/CoreNodeModels/Properties/Resources.Designer.cs @@ -19,7 +19,7 @@ namespace CoreNodeModels.Properties { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] public class Resources { @@ -286,7 +286,7 @@ public static string CustomSelectionSearchTags { } /// - /// Looks up a localized string similar to Creates a dateTime object from a formatted date and time string. Date and time must be in the format "April 12, 1977 12:00 PM". + /// Looks up a localized string similar to Creates a dateTime object from a formatted date and time string. Date and time must be in the default DateTime format "MMMM dd, yyyy h:mm tt", e.g. "April 02, 1977 12:00 PM". /// public static string DateTimeDescription { get { diff --git a/src/Libraries/CoreNodeModels/Properties/Resources.en-US.resx b/src/Libraries/CoreNodeModels/Properties/Resources.en-US.resx index a903faaabd2..d94cfe54915 100644 --- a/src/Libraries/CoreNodeModels/Properties/Resources.en-US.resx +++ b/src/Libraries/CoreNodeModels/Properties/Resources.en-US.resx @@ -1,4 +1,4 @@ - +