REST converting ISO dates in character fields to US dates

That should not be too hard. If you are assigning a string value, just take it as is. If you are assigning a date value, expect the input to be ISO formatted, else fail. Kinetic UI always uses ISO, and REST programmers ought to be educated.

Of course, if they leave it in the mode they have it now, since it IS a DateTime, they could parse it back out to an ISO string, if it was a text field, but that sounds dangerous as well as redundant. Still have to do type checking.

I really don’t understand why they are doing all this extra code anyway. They have the types defined, why not just deserialize directly to the damn things?

Wouldn’t that drop the milliseconds and the timezone?

That’s why I said it was dangerous. You might be able to make it work, but too many moving parts.

Edit, I mean you can do this:
dt.ToString("yyyy-MM-ddTHH:mm:ss.fffZ", CultureInfo.InvariantCulture)

But what all is Newtonsoft parsing? Did it come in that way? How do we know?
So → dangerous. Might even be worse.

It would transform strings like 2013-07-02T09:00:00-7:00

You are correct that it could mangle it, but what I showed will come back out correctly for this input:

In: 2023-07-17T15:43:42.461Z
Out: 2023-07-17T15:43:42.461Z

Still very dangerous because there are a lot of unknowns though, I would not try something like that at all.

If they turned off the Date Handling, then this would fix it:

row[column] = column.DataType.Name == "DateTime" ? DateTime.Parse((string)columnValue) : columnValue;

I guess to be absolutely safe we could check the type of the incoming columnValue as well.

Just musing, but in upstream code, they should already be passing a JsonSerializer settings object somewhere, because I by default I believe numbers without decimals come in as longs, so how are they handling that if they try to shove it in an int field? :thinking:

Will it do an implicit conversion? Questions, Questions.

Ok, I’m answering my own question. It will do an implicit conversion and will overflow if it’s too big.

I take that back, because the Parse would ignore that too.

Epicor should consider a bug bounty program! And kick it off with this one.

1 Like

love it

It might really be getting fixed!

Four days after pointing support to this thread and @josecgomez 's work, this has been added to my support ticket:

Development Notes 2023-07-28 09:56:07

  Development Task TASK7256570 had notes added:
Problem PRB0267943 have been updated:
PD State have been updated to: Accepted
2 Likes

I received a similar message two days ago:

2023-07-26 07:34:13 -Development Notes
Development Task TASK7262139 had notes added:
Problem PRB0269263 have been updated:
PD State have been updated to: Accepted

Note that multiple cases apparently lead to multiple problem records.

Of course this is no guarantee that it will actually be fixed nor any indication in which version.

1 Like

Here’s hoping that doesn’t also mean multiple solutions…

hopes and dreams GIF

Here is the response I got today:

Kevin,
This has been logged as a bug and accepted by development. There unfortunately wasn’t a PRB associated with it so I cannot like the PRB to the case.
The dev bug is ERPS-203145. There isn’t a ETA on a fix as of yet.

2 Likes

As far as I can tell PRB0267943 is still super active and not closed out? Last update was,

Problem has been updated by: Development Notes
Problem PRB0267943 have been updated:
PD State have been updated to: In Testing

Kevin,
I was able to locate the PRB associated with this bug. It’s PRB0269263.
I’ve attached that to the case and since this has been accepted by development, you should see it appear in the My problems tab in EpicCare and you can follow it’s progress.

PRB0269263.

Hey maybe if they deploy two fixes at the same time it’ll be twice as fixed!

It’s related but not the same. Hopefully they are coordinating.

PRB0269263 state is Closed Complete