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

Fix more than 3 digits for milliseconds in datetime #409

Merged
merged 3 commits into from
Jul 6, 2022

Conversation

sowu880
Copy link
Contributor

@sowu880 sowu880 commented Jun 30, 2022

Fix issue #401

@sowu880 sowu880 linked an issue Jun 30, 2022 that may be closed by this pull request
@sowu880 sowu880 requested a review from yankunhuang-pku June 30, 2022 07:42
@@ -37,7 +37,8 @@ public PartialDateTime(string input, DateTimeType type = DateTimeType.Fhir)
int hour = groups["hour"].Success ? int.Parse(groups["hour"].Value) : 0;
int minute = groups["minute"].Success ? int.Parse(groups["minute"].Value) : 0;
int second = groups["second"].Success ? int.Parse(groups["second"].Value) : 0;
int millisecond = groups["millisecond"].Success ? int.Parse(groups["millisecond"].Value) : 0;
int millisecond = groups["millisecond"].Success ? int.Parse(groups["millisecond"].Value.Length > 3 ? groups["millisecond"].Value.Substring(0, 3) : groups["millisecond"].Value) : 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 4th digit is invalid?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4th is invalid when new a datetime object in .net.
So we both save string part of millisecond and 3 digits as int value here.

@sowu880 sowu880 merged commit a385edc into dotliquid Jul 6, 2022
@sowu880 sowu880 deleted the personal/sowu/fix-datetime branch July 6, 2022 05:42
QuanWanxx added a commit that referenced this pull request Jul 6, 2022
* Fix more than 3 digits for milliseconds in datetime (#409)

* fix

* fix

* Update version to 5.0.3 (#412)

Co-authored-by: sowu880 <[email protected]>
sowu880 added a commit that referenced this pull request Oct 27, 2022
* Update README.md

* Create HL7v2-templates.md

* Create HL7v2-FHIRValidator.md

* Create HL7v2-ImportantPoints.md

* Update README.md

* Update README.md

Updated STU3-R4 information for OSS FHIR Server

* Fix StyleCop Dependency (#397)

- Fix build-time dependency on StyleCop.Analyzers to no longer force consumers to use the same analyzers

* Bump Newtonsoft.Json in /src/Microsoft.Health.Fhir.TemplateManagement

Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 12.0.3 to 13.0.1.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](JamesNK/Newtonsoft.Json@12.0.3...13.0.1)

---
updated-dependencies:
- dependency-name: Newtonsoft.Json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump Newtonsoft.Json from 12.0.3 to 13.0.1 in src/Microsoft.Health.Fhir.TemplateManagement/Microsoft.Health.Fhir.Liquid.Converter.nuspec

* Exclude data folder

* Update the GeoPol

* Update version

* Remove StyleCop from Nuspec (#410)

- Remove StyleCop from the nuspec to prevent forcing consumers to import StyleCop

* Prepare new release for 5.0.3 (#413)

* Fix more than 3 digits for milliseconds in datetime (#409)

* fix

* fix

* Update version to 5.0.3 (#412)

Co-authored-by: sowu880 <[email protected]>

* Add NJsonSchema dependency to nuspec file (#423)

* Prepare new release for 5.0.5 (#425)

* Update version to 5.0.5 (#424)

* Interface to convert JObject (#416)

* build: Insert missing ampersand

* build: Fix bin-folder creation

* build: fix mkdir command for windows

* build: unfix mkdir command for windows

* build: remove double binfolder

* build: Ignore error in folder creation

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: yankunhuang-pku <[email protected]>
Co-authored-by: ginalee-dotcom <[email protected]>
Co-authored-by: sowu880 <[email protected]>
Co-authored-by: Irene Joseph <[email protected]>
Co-authored-by: Qiwei Jin <[email protected]>
Co-authored-by: Will Sugarman <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yankun Huang <[email protected]>
Co-authored-by: Yue Fei <[email protected]>
Co-authored-by: Will Sugarman <[email protected]>
Co-authored-by: QuanWanxx <[email protected]>
sowu880 added a commit that referenced this pull request Nov 25, 2022
* Update README.md

* Create HL7v2-templates.md

* Create HL7v2-FHIRValidator.md

* Create HL7v2-ImportantPoints.md

* Update README.md

* Update README.md

Updated STU3-R4 information for OSS FHIR Server

* Fix StyleCop Dependency (#397)

- Fix build-time dependency on StyleCop.Analyzers to no longer force consumers to use the same analyzers

* Bump Newtonsoft.Json in /src/Microsoft.Health.Fhir.TemplateManagement

Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from 12.0.3 to 13.0.1.
- [Release notes](https://github.com/JamesNK/Newtonsoft.Json/releases)
- [Commits](JamesNK/Newtonsoft.Json@12.0.3...13.0.1)

---
updated-dependencies:
- dependency-name: Newtonsoft.Json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>

* Bump Newtonsoft.Json from 12.0.3 to 13.0.1 in src/Microsoft.Health.Fhir.TemplateManagement/Microsoft.Health.Fhir.Liquid.Converter.nuspec

* Exclude data folder

* Update the GeoPol

* Update version

* Remove StyleCop from Nuspec (#410)

- Remove StyleCop from the nuspec to prevent forcing consumers to import StyleCop

* Prepare new release for 5.0.3 (#413)

* Fix more than 3 digits for milliseconds in datetime (#409)

* fix

* fix

* Update version to 5.0.3 (#412)

Co-authored-by: sowu880 <[email protected]>

* Add NJsonSchema dependency to nuspec file (#423)

* Prepare new release for 5.0.5 (#425)

* Update version to 5.0.5 (#424)

* Interface to convert JObject (#416)

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: yankunhuang-pku <[email protected]>
Co-authored-by: ginalee-dotcom <[email protected]>
Co-authored-by: Irene Joseph <[email protected]>
Co-authored-by: Qiwei Jin <[email protected]>
Co-authored-by: Will Sugarman <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Yankun Huang <[email protected]>
Co-authored-by: Yue Fei <[email protected]>
Co-authored-by: Will Sugarman <[email protected]>
Co-authored-by: QuanWanxx <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

format_as_date_time - conversion issue
2 participants