Skip to content

[ServiceNow] Support different date, time and datetime formats #88

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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from

Conversation

anup-cloudsufi
Copy link

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

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
Member

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
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
Member

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
Member

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
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
Member

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?

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
Member

@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
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