date fields of GS1 barcodes should consider the timezone offset#2
Open
yoolandes wants to merge 1 commit intoMaximBelov:masterfrom
Open
date fields of GS1 barcodes should consider the timezone offset#2yoolandes wants to merge 1 commit intoMaximBelov:masterfrom
yoolandes wants to merge 1 commit intoMaximBelov:masterfrom
Conversation
seanlynch7194
approved these changes
Dec 9, 2025
seanlynch7194
left a comment
There was a problem hiding this comment.
I ran the updated code through the scenario that previously triggered the bug and can confirm the patch resolves it. No unexpected behaviour observed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment the method
parseBarcodeinstantiates a date with the users current timezone. This could be problematic when storing the values of the date fields in a database.For example the library parses the following GS1 barcode:
15240300A user who lives in a timezone with a negative offset of minus 1 hour would send the following ISO date to the server: `2024-03-30T23:00:00.000Z
The server interprets the date as an UTC date and would store the wrong value "2024-03-30" in the database.
Reading the date fields as UTC dates would fix this problem.