-
Notifications
You must be signed in to change notification settings - Fork 141
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
feat: add iso year and week feature #386
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Risk Level 2 - /home/runner/work/graphic-walker/graphic-walker/packages/graphic-walker/src/lib/vega.ts The code is generally well-written, but there are a few areas where improvements can be made for readability and maintainability.
let result = rowRepeatFields.map((rowField, i) => {
return colRepeatFields.map((colField, j) => {
// ...existing code...
});
}).flat(); This will make your code more idiomatic and easier to understand. Risk Level 2 - /home/runner/work/graphic-walker/graphic-walker/packages/graphic-walker/src/components/dropdownSelect/combobox.tsx The code is generally well written, but there is a potential issue with the onSelect={() => {
if (opt.value === '_none') {
onSelect?.('');
} else {
onSelect?.(opt.value === selectedKey ? '' : opt.value);
}
setOpen(false);
}} Risk Level 3 - /home/runner/work/graphic-walker/graphic-walker/packages/graphic-walker/src/lib/op/dateTimeDrill.ts The code is generally well written, but there is a potential issue with the case 'iso_year': {
const newValues = fieldValues.map((v) => {
const date = newDate(v);
const _Y = date.getFullYear();
const dayInFirstWeek = toOffsetDate(_Y, 0, 4);
const firstMondayOfYear = newDate(newDate(dayInFirstWeek).setDate(dayInFirstWeek.getDate() - (dayInFirstWeek.getDay() || 7) + 1));
if (date.getTime() < firstMondayOfYear.getTime()) {
return formatDate(toOffsetDate(_Y - 1, 0, 1));
}
const nextDayInFirstWeek = toOffsetDate(_Y + 1, 0, 4);
const nextFirstMondayOfYear = newDate(
newDate(nextDayInFirstWeek).setDate(nextDayInFirstWeek.getDate() - (nextDayInFirstWeek.getDay() || 7) + 1)
);
return formatDate(toOffsetDate(date.getTime() < nextFirstMondayOfYear.getTime() ? _Y : _Y + 1, 0, 1));
});
return {
...data,
[resKey]: newValues,
};
} 📚🔧🔍 Powered by Code Review GPT |
add the iso feature of temporal fields.
