Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LongDateTimeFormatWithFactionOfSecond format for date parsing #118

Merged
merged 2 commits into from
Oct 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions NHapi20/NHapi.Base/Model/Primitive/TSComponentOne.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/// Contributor(s): ______________________________________.
///
/// Alternatively, the contents of this file may be used under the terms of the
/// GNU General Public License (the GPL), in which case the provisions of the GPL are
/// GNU General Public License (the "GPL"), in which case the provisions of the GPL are
/// applicable instead of those above. If you wish to allow use of your version of this
/// file only under the terms of the GPL and not to allow others to use your version
/// of this file under the MPL, indicate your decision by deleting the provisions above
Expand Down Expand Up @@ -245,20 +245,20 @@ protected virtual string LongDateTimeFormat
protected virtual string LongDateTimeFormatWithSecond
{
get { return "yyyyMMddHHmmss"; }
}

/// <summary>
/// Used for setting the format of a long date (Year, Month, Day, Hour, Minute, Second, Offset from GMT)
/// </summary>
protected virtual string LongDateTimeFormatWithOffset
{
get { return "yyyyMMddHHmmsszzz"; }
}

/// <summary>
/// Used for setting the format of a long date (Year, Month, Day, Hour, Minute, Second, Fraction of second)
/// </summary>
protected virtual string LongDateTimeFormatWithFactionOfSecond
}

/// <summary>
/// Used for setting the format of a long date (Year, Month, Day, Hour, Minute, Second, Offset from GMT)
/// </summary>
protected virtual string LongDateTimeFormatWithOffset
{
get { return "yyyyMMddHHmmsszzz"; }
}

/// <summary>
/// Used for setting the format of a long date (Year, Month, Day, Hour, Minute, Second, Fraction of second)
/// </summary>
protected virtual string LongDateTimeFormatWithFractionOfSecond
{
get { return "yyyyMMddHHmmss.FFFF"; }
}
Expand All @@ -279,7 +279,7 @@ public virtual DateTime GetAsDate()
{
try
{
string[] dateFormats = new string[] {LongDateTimeFormat, ShortDateTimeFormat, LongDateTimeFormatWithSecond, LongDateTimeFormatWithOffset };
string[] dateFormats = new string[] { LongDateTimeFormat, ShortDateTimeFormat, LongDateTimeFormatWithSecond, LongDateTimeFormatWithOffset, LongDateTimeFormatWithFractionOfSecond };
DateTime val = DateTime.MinValue;
CultureInfo culture = Thread.CurrentThread.CurrentCulture;
if (Value != null && Value.Length > 0)
Expand Down Expand Up @@ -325,7 +325,7 @@ public virtual void SetLongDateWithSecond(DateTime value)
/// <param name="value"></param>
public virtual void SetLongDateWithFractionOfSecond(DateTime value)
{
Set(value, LongDateTimeFormatWithFactionOfSecond);
Set(value, LongDateTimeFormatWithFractionOfSecond);
}

/// <summary>
Expand Down