Published
Edited
Aug 8, 2019
1 fork
Insert cell
Insert cell
rschedule = import('@rschedule/rschedule@0.11.3')
Insert cell
// standardAdapter = import('https://unpkg.com/@rschedule/standard-date-adapter@0.11.0/build/module.js?module')
standardAdapter = import('@rschedule/standard-date-adapter@0.11.0')
Insert cell
rschedule.RScheduleConfig.defaultDateAdapter = standardAdapter.StandardDateAdapter;
Insert cell
// jsonTools = import('https://unpkg.com/@rschedule/json-tools@0.11.0/build/main.js?module')
jsonTools = import('@rschedule/json-tools')
Insert cell
Insert cell
// Here's a Rule not getting it's data defined.
ruleA = new rschedule.Rule({
frequency: 'YEARLY',
byMonthOfYear: [2, 6],
byDayOfWeek: ['SU', ['MO', 3]],
start: new Date(2010, 1, 7),
data: 'Title of RULE',
duration: 45454545,
dateAdapter: standardAdapter.StandardDateAdapter
});
Insert cell
Insert cell
// Here's a Date getting it's data defined.
dateA = new rschedule.Dates({
dates: [new Date(2000,6,23)],
duration: 5454,
data: 'Title of date',
dateAdapter: standardAdapter.StandardDateAdapter
});
Insert cell
Insert cell
scheduleA = new rschedule.Schedule({
rdates: [new Date(1800,10,23)], // This works
data: "Schedule Title",
dateAdapter: standardAdapter.StandardDateAdapter,
} );
Insert cell
Insert cell
jsonTools.serializeToJSON(ruleA, {serializeData: true})
Insert cell
jsonTools.serializeToJSON(dateA, {serializeData: true})
Insert cell
jsonTools.serializeToJSON(scheduleA, {serializeData: true})
Insert cell
Insert cell

One platform to build and deploy the best data apps

Experiment and prototype by building visualizations in live JavaScript notebooks. Collaborate with your team and decide which concepts to build out.
Use Observable Framework to build data apps locally. Use data loaders to build in any language or library, including Python, SQL, and R.
Seamlessly deploy to Observable. Test before you ship, use automatic deploy-on-commit, and ensure your projects are always up-to-date.
Learn more