Skip to content

Feature branch#1361

Open
saigusa-hisashi wants to merge 2 commits intosubstance:masterfrom
saigusa-hisashi:feature-branch
Open

Feature branch#1361
saigusa-hisashi wants to merge 2 commits intosubstance:masterfrom
saigusa-hisashi:feature-branch

Conversation

@saigusa-hisashi
Copy link
Copy Markdown

Why

Please describe why you are suggesting the PR.

What

Elaborate what your changes do, and how they address the problem described.

The original _exportDate function called `date.split('-')` before validating the format of the date string. This could lead to `month` or `day` variables being `undefined` if the date string was not in the expected format.

Passing `undefined` to the XML element's `append` method likely caused a runtime error, preventing the XML from being generated.

This commit refactors the function to only parse the year, month, and day from the date string after the string has been successfully validated against a corresponding format (YYYY-MM-DD, YYYY-MM, or YYYY). This prevents runtime errors from invalid date formats during XML export.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant