Content-Length: 325989 | pFad | http://github.com/notion-dotnet/notion-sdk-net/pull/433

B6 Fix: date custom converter to serialize and deserialize ISO 8601 date and time by KoditkarVedant · Pull Request #433 · notion-dotnet/notion-sdk-net · GitHub
Skip to content

Fix: date custom converter to serialize and deserialize ISO 8601 date and time #433

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

Merged
merged 4 commits into from
Apr 12, 2025

Conversation

KoditkarVedant
Copy link
Contributor

@KoditkarVedant KoditkarVedant commented Apr 12, 2025

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes #425 & #429

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Test A
  • Test B

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

@KoditkarVedant KoditkarVedant requested a review from Copilot April 12, 2025 19:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

Src/Notion.Client/Models/PropertyValue/DateCustomConverter.cs:45

  • [nitpick] Consider using CultureInfo.InvariantCulture when formatting the date (e.g., value.Start.Value.ToString(startFormat, CultureInfo.InvariantCulture)) to ensure consistent serialization across different locales.
writer.WriteValue(value.Start.Value.ToString(startFormat));

Src/Notion.Client/Models/PropertyValue/DateCustomConverter.cs:52

  • [nitpick] Consider using CultureInfo.InvariantCulture when formatting the 'end' date (e.g., value.End.Value.ToString(endFormat, CultureInfo.InvariantCulture)) for consistent behavior regardless of system culture.
writer.WriteValue(value.End.Value.ToString(endFormat));

@KoditkarVedant KoditkarVedant requested a review from Copilot April 12, 2025 19:21
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

Src/Notion.Client/Models/PropertyValue/DatePropertyValue.cs:51

  • Verify that excluding the IncludeTime property from JSON serialization is intentional, as the custom converter handles the time formatting.
[JsonIgnore]

…nsistent parsing of ISO 8601 dates across different environments

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@KoditkarVedant KoditkarVedant requested a review from Copilot April 12, 2025 19:39
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

@KoditkarVedant KoditkarVedant merged commit 78cec41 into main Apr 12, 2025
6 checks passed
@KoditkarVedant KoditkarVedant deleted the fix/date-serialization branch April 12, 2025 19:45
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.

Incorrect mapping when RollupValue type is Date
1 participant








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/notion-dotnet/notion-sdk-net/pull/433

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy