@event-calendar/core
Advanced tools
Comparing version 3.1.0 to 3.2.0
{ | ||
"name": "@event-calendar/core", | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"title": "Event Calendar Core package", | ||
@@ -5,0 +5,0 @@ "description": "Full-sized drag & drop event calendar with resource & timeline views", |
@@ -127,6 +127,6 @@ export const DAY_IN_SECONDS = 86400; | ||
/** | ||
* Get duration value in seconds or default value if duration is undefined | ||
* Get duration value in seconds | ||
*/ | ||
export function toSeconds(duration, defaultValue = 0) { | ||
return duration?.seconds ?? defaultValue; | ||
export function toSeconds(duration) { | ||
return duration.seconds; | ||
} | ||
@@ -133,0 +133,0 @@ |
@@ -10,1 +10,13 @@ export function createResources(input) { | ||
} | ||
export function resourceBackgroundColor(event, resources) { | ||
return findResource(event, resources)?.eventBackgroundColor; | ||
} | ||
export function resourceTextColor(event, resources) { | ||
return findResource(event, resources)?.eventTextColor; | ||
} | ||
function findResource(event, resources) { | ||
return resources.find(resource => event.resourceIds.includes(resource.id)); | ||
} |
@@ -142,3 +142,3 @@ import { | ||
hiddenDays: days => [...new Set(days)], | ||
highlightedDates: dates => dates.map(createDate), | ||
highlightedDates: dates => dates.map(date => setMidnight(createDate(date))), | ||
resources: createResources, | ||
@@ -145,0 +145,0 @@ scrollTime: createDuration, |
@@ -8,3 +8,2 @@ import {get, writable} from 'svelte/store'; | ||
dayGrid, | ||
monthView, | ||
events, | ||
@@ -42,3 +41,2 @@ now, | ||
this._dayGrid = dayGrid(this); | ||
this._monthView = monthView(this); | ||
this._currentRange = currentRange(this); | ||
@@ -61,5 +59,2 @@ this._activeRange = activeRange(this); | ||
this._viewComponent = writable(undefined); | ||
// Resources | ||
this._resBgColor = writable(noop); | ||
this._resTxtColor = writable(noop); | ||
// Interaction | ||
@@ -66,0 +61,0 @@ this._interaction = writable({}); |
@@ -25,6 +25,2 @@ import {derived, writable, readable, get} from 'svelte/store'; | ||
export function monthView(state) { | ||
return derived(state.view, $view => $view?.includes('Month')); | ||
} | ||
export function activeRange(state) { | ||
@@ -56,6 +52,6 @@ return derived( | ||
return derived( | ||
[state.date, state.duration, state.firstDay, state._monthView], | ||
([$date, $duration, $firstDay, $_monthView]) => { | ||
[state.date, state.duration, state.firstDay], | ||
([$date, $duration, $firstDay]) => { | ||
let start = cloneDate($date), end; | ||
if ($_monthView) { | ||
if ($duration.months) { | ||
start.setUTCDate(1); | ||
@@ -62,0 +58,0 @@ } else if ($duration.inWeeks) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
227815
4420
2895