-
Notifications
You must be signed in to change notification settings - Fork 271
feat(time-format): add full-date to weekly time formatter #486
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/superset/superset-ui/2f5dr9a15 |
Codecov Report
@@ Coverage Diff @@
## master #486 +/- ##
==========================================
+ Coverage 22.73% 22.75% +0.01%
==========================================
Files 276 276
Lines 6672 6672
Branches 645 645
==========================================
+ Hits 1517 1518 +1
Misses 5115 5115
+ Partials 40 39 -1
Continue to review full report at Codecov.
|
'1969-12-28T00:00:00Z/P1W': SUNDAY_BASED_WEEK, // 'week_start_sunday' | ||
'1969-12-29T00:00:00Z/P1W': MONDAY_BASED_WEEK, // 'week_start_monday' | ||
'P1W/1970-01-03T00:00:00Z': SUNDAY_BASED_WEEK, // 'week_ending_saturday' | ||
'P1W/1970-01-04T00:00:00Z': MONDAY_BASED_WEEK, // 'week_ending_sunday' | ||
}; | ||
|
||
export type TimeGranularity = keyof typeof formats; | ||
export type TimeGranularity = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a known issue with re-exporting type for library.
export {
default as getTimeFormatterForGranularity,
TimeGranularity,
} from './factories/getTimeFormatterForGranularity';
there will be issue with TimeGranularity
in the consumer app.
Have to create ./types.ts
and put this type there
then in index
export * from './types.ts'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it mean the consumer apps will have to import from '@sueprset-ui/time-format/src/types
too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no they can
import { TimeGranularity } from '@superset-ui/time-format';
formData={formData} | ||
formData={{ | ||
...formData, | ||
timeGrainSqla: 'P1W', // weekly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want to make another story for this or remove the change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a new story.
🏆 Enhancements
BigNumber trendline uses time formatter based on granularity. Currently the formatter weekly periods is not very helpful. We add full date to the formatted string so users don't have to compute which month/day the week is on their own.
Before
After