Adjust European short trip heuristic from >3 days to >1 day to correctly detect when user has returned home from European trips. This fixes the April 29-30, 2023 case where the location incorrectly showed "Sankt Georg, Hamburg" instead of "Bristol" when the user was free (no events scheduled) after the foss-north trip ended on April 27. The previous logic required more than 3 days to pass before assuming return home from European countries, but for short European trips by rail/ferry, users typically return within 1-2 days. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
53 lines
1.7 KiB
JavaScript
53 lines
1.7 KiB
JavaScript
import { createPlugin } from '@fullcalendar/core/index.js';
|
|
import { ListView } from './internal.js';
|
|
import { identity, createFormatter } from '@fullcalendar/core/internal.js';
|
|
import '@fullcalendar/core/preact.js';
|
|
|
|
const OPTION_REFINERS = {
|
|
listDayFormat: createFalsableFormatter,
|
|
listDaySideFormat: createFalsableFormatter,
|
|
noEventsClassNames: identity,
|
|
noEventsContent: identity,
|
|
noEventsDidMount: identity,
|
|
noEventsWillUnmount: identity,
|
|
// noEventsText is defined in base options
|
|
};
|
|
function createFalsableFormatter(input) {
|
|
return input === false ? null : createFormatter(input);
|
|
}
|
|
|
|
var index = createPlugin({
|
|
name: '@fullcalendar/list',
|
|
optionRefiners: OPTION_REFINERS,
|
|
views: {
|
|
list: {
|
|
component: ListView,
|
|
buttonTextKey: 'list',
|
|
listDayFormat: { month: 'long', day: 'numeric', year: 'numeric' }, // like "January 1, 2016"
|
|
},
|
|
listDay: {
|
|
type: 'list',
|
|
duration: { days: 1 },
|
|
listDayFormat: { weekday: 'long' }, // day-of-week is all we need. full date is probably in headerToolbar
|
|
},
|
|
listWeek: {
|
|
type: 'list',
|
|
duration: { weeks: 1 },
|
|
listDayFormat: { weekday: 'long' },
|
|
listDaySideFormat: { month: 'long', day: 'numeric', year: 'numeric' },
|
|
},
|
|
listMonth: {
|
|
type: 'list',
|
|
duration: { month: 1 },
|
|
listDaySideFormat: { weekday: 'long' }, // day-of-week is nice-to-have
|
|
},
|
|
listYear: {
|
|
type: 'list',
|
|
duration: { year: 1 },
|
|
listDaySideFormat: { weekday: 'long' }, // day-of-week is nice-to-have
|
|
},
|
|
},
|
|
});
|
|
|
|
export { index as default };
|