Skip to content

[Feat]: Change pickup_min_datetime and pickup_max_datetime Shipment Options types to string #520

@gkeasypost

Description

@gkeasypost

Feature Request Is New

  • I have verified that the requested feature does not already exist or has not already been requested.

Description of the feature

In the Options model, the pickup_min_datetime and pickup_max_datetime options should be a string type instead of a DateTime type in order to maintain consistency with what the EasyPost API returns for those options, as well as the same type as delivery_min_datetime and delivery_max_datetime.

see:
https://www.easypost.com/docs/api#options
https://github.com/EasyPost/easypost-csharp/blob/master/EasyPost/Models/API/Options.cs#L683
https://github.com/EasyPost/easypost-csharp/blob/master/EasyPost/Models/API/Options.cs#L689

Activity

nwithan8

nwithan8 commented on Sep 26, 2023

@nwithan8
Contributor

Hey, thanks for reaching out! This is being discussed internally about the best way to handle non-primatives, particularly dates, in our client libraries, whether to keep them as strings as they are in the raw JSON, or whether to de/serialize them to language-specific elements (e.g. a DateTime in .NET).

Right now, it seems there is a mix of both throughout the library, so we will try to standardize it one way or another via a breaking change release.

We'll keep you updated. If any other developer would like to weigh in on what would be suit their expectations, please chime in!

joe-rohde

joe-rohde commented on Nov 22, 2023

@joe-rohde

Standardizing these dates is important for working with different carrier requirements. Is there a timeline on when this will be addressed?

nwithan8

nwithan8 commented on Nov 22, 2023

@nwithan8
Contributor

Hey @joe-rohde , thanks for weighing in.

Unfortunately, we do not have a projected timeline or any updates to share regarding this.

If you could, can you elaborate on how the DateTime versus string type of a date is interfering with your usage of EasyPost? It will help us diagnose the issue and influence our decision about which paradigm to adopt.

joe-rohde

joe-rohde commented on Nov 22, 2023

@joe-rohde
joe-rohde

joe-rohde commented on Jan 17, 2024

@joe-rohde

Any update on the effort in standardizing the datetimes in the API?

Justintime50

Justintime50 commented on Jan 17, 2024

@Justintime50
Member

Hey Joe, thanks for the example with CDL. Mind supplying a few more details so we can investigate the root cause further? You mentioned you are seeing a discrepancy with the datetimes you provided and what the API returns and that it’s causing the wrong datetimes in the CDL system - can you elaborate on the affect of that behavior? The datetimes provided appear the same with the exception of the response containing the timezone as UTC, is that what is causing the wrong datetimes? If so, does supplying your desired timezone in the datetime correct the problem? Our system will default to UTC when no timezone is supplied which may explain the discrepancy.

If that isn’t the problem or doesn’t correct the discrepancy, it would be helpful to have a shipment ID for a recent purchased CDL shipment that contains this problem so we can check it on our end.

We are still determining how to unify the datetime fields in this library and have no immediate plans to ship a breaking change release of this library to accomplish that. In the meantime, I’d love to help you get these datetime option fields working with CDL if possible.

Justintime50

Justintime50 commented on Mar 18, 2025

@Justintime50
Member

Hey @joe-rohde, are you able to respond to the above with more info? It would help us know better how to proceed.

nwithan8

nwithan8 commented on Mar 18, 2025

@nwithan8
Contributor

This issue boils down to that this is the raw string from the API, while this gets converted from the raw string into a DateTime object which, when converted back into a string via something like a .ToString() method, is converted into a different %H:%m:%s-like format.

The end user could change the format used when stringifying a DateTime object to standardize it, or the SDK could use DateTime consistently for all date/time strings returned by the API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageIssue is being researched

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nwithan8@Justintime50@joe-rohde@gkeasypost

        Issue actions

          [Feat]: Change pickup_min_datetime and pickup_max_datetime Shipment Options types to string · Issue #520 · EasyPost/easypost-csharp