Skip to content

Conversation

@anup-cloudsufi
Copy link
Contributor

Support different date, time and datetime formats to handle the ServiceNow datetime parsing issue.

Reference date & time formats: https://www.servicenow.com/docs/bundle/washingtondc-api-reference/page/app-store/dev_portal/API_reference/GlideDateTime/concept/c_GlideDateTimeAPI.html

@google-cla
Copy link

google-cla bot commented May 15, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@anup-cloudsufi anup-cloudsufi marked this pull request as ready for review May 16, 2025 08:43
Comment on lines 68 to 69
.appendOptional(DateTimeFormatter.ofPattern("HH:mm:ss"))
.appendOptional(DateTimeFormatter.ofPattern("HH:mm"))
Copy link
Contributor

Choose a reason for hiding this comment

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

unable to find this in reference link pasted above, can you please point me to the doc where these are mentioned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is no direct reference to time format in the link, so used the time patterns from the datetime patterns.

Copy link
Contributor

Choose a reason for hiding this comment

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

why not hh:mm:ss a && hh.mm.ss a?

Copy link
Contributor

Choose a reason for hiding this comment

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

Also are all of these tested? We should not do guess work in prod plugins.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Regarding support for AM/PM those are majorly used with datetime and not time, hence didn't add it.

Regarding the testing, most of them are tested using the unit test and one of the failure pattern was verified by the customer runs.

Copy link
Contributor

Choose a reason for hiding this comment

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

unit testing is one thing but how do we know if they are actually supported by service now if we have added them based on assumption from datetime patterns. Did we do an e2e test with the actual service now data?

Copy link
Contributor

Choose a reason for hiding this comment

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

removed non-redundant time patterns as confirmed with Servicenow UI, the removed patterns are not required

@prince-cs prince-cs requested a review from itsankit-google May 22, 2025 13:51
Copy link
Contributor

@itsankit-google itsankit-google left a comment

Choose a reason for hiding this comment

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

I don't see e2e tests for added time formats.

Also I don't see any e2e tests running:
image

@prince-cs prince-cs added build and removed build labels May 22, 2025
@prince-cs
Copy link
Contributor

e2e tests are being enabled for servicenow in #89.

@itsankit-google
Copy link
Contributor

e2e tests are being enabled for servicenow in #89.

We need to enable it first, run against this PR. Then only adding any e2e tests make sense.

Copy link
Contributor

@itsankit-google itsankit-google left a comment

Choose a reason for hiding this comment

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

Fix e2e test failures.

@prince-cs
Copy link
Contributor

@prince-cs prince-cs force-pushed the bugfix/support-different-datetime-formats branch from 14b9c2f to 8dc6b5e Compare June 2, 2025 16:42
@prince-cs prince-cs merged commit 5b53e3b into develop Jun 2, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants