feat(ava/data): add function to parse ISO date string to js Date type #770
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.
PR includes
PR #749 中提到需要在绘制折线图等横轴为时间的图表时,将识别为日期字段的数据转换为标准日期格式传入 G2 spec 中,但
new Date()
的生效范围和ava/data
中识别日期的方式不一致, 因此提供一个函数使用和识别日期格式相同的正则来解析日期字符串。#749 try to parse date string to js
Date
bynew Date()
when draw line chart, but some date string like '1996-W08' cannot be parsed bynew Date()
. Sodata
provide a tool function to parse ISO 8601 date string to Date, using the same regular expressions that has been used for filed type recommendation.