"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/common/src/common/nav-link.ts" between
fullcalendar-5.9.0.tar.gz and fullcalendar-5.10.0.tar.gz

About: FullCalendar is a full-sized drag & drop JavaScript event calendar.

nav-link.ts  (fullcalendar-5.9.0):nav-link.ts  (fullcalendar-5.10.0)
import { formatDayString } from '../datelib/formatting-utils' import { createFormatter } from '../datelib/formatting'
import { DateMarker } from '../datelib/marker' import { DateMarker } from '../datelib/marker'
import { createAriaClickAttrs } from '../util/dom-event'
import { formatWithOrdinals } from '../util/misc'
import { ViewContext } from '../ViewContext'
export function buildNavLinkData(date: DateMarker, type = 'day') { const DAY_FORMAT = createFormatter({ year: 'numeric', month: 'long', day: 'numer
return JSON.stringify({ ic' })
date: formatDayString(date), const WEEK_FORMAT = createFormatter({ week: 'long' })
type,
}) export function buildNavLinkAttrs(
context: ViewContext,
dateMarker: DateMarker,
viewType = 'day',
isTabbable = true,
) {
const { dateEnv, options, calendarApi } = context
let dateStr = dateEnv.format(dateMarker, viewType === 'week' ? WEEK_FORMAT : D
AY_FORMAT)
if (options.navLinks) {
let zonedDate = dateEnv.toDate(dateMarker)
const handleInteraction = (ev: UIEvent) => {
let customAction =
viewType === 'day' ? options.navLinkDayClick :
viewType === 'week' ? options.navLinkWeekClick : null
if (typeof customAction === 'function') {
customAction.call(calendarApi, dateEnv.toDate(dateMarker), ev)
} else {
if (typeof customAction === 'string') {
viewType = customAction
}
calendarApi.zoomTo(dateMarker, viewType)
}
}
return {
title: formatWithOrdinals(options.navLinkHint, [dateStr, zonedDate], dateS
tr),
'data-navlink': '', // for legacy selectors. TODO: use className?
...(isTabbable
? createAriaClickAttrs(handleInteraction)
: { onClick: handleInteraction }
),
}
}
return { 'aria-label': dateStr }
} }
 End of changes. 3 change blocks. 
6 lines changed or deleted 48 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)