Skip to content

About

Nextcloud Calendar front-end API

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

@nextcloud/calendar

Extension API of the Nextcloud Calendar app. Other Nextcloud apps use it to extend the calendar, starting with the event editor.

Warning

This library is a pre-release and not yet implemented in the Calendar app. Extensions registered with it have no effect yet, and the API may still change between any versions. Follow the progress in nextcloud/calendar#8522.

Installation

npm install @nextcloud/calendar

Examples

Extending the event editor

import { registerEventEditorExtension } from '@nextcloud/calendar'

const registration = registerEventEditorExtension({
	app: 'myapp',
	name: 'my-field',
	setup({ event, editor }) {
		const icon = document.createElement('span')
		const field = document.createElement('input')

		editor.addField({ icon, field })

		event.onSave({
			callback: () => {
				event.setProperty({ name: 'X-MYAPP-VALUE', value: field.value })
			},
		})
	},
})

// Remove the extension again
registration.unregister()

Features & Roadmap

Version Feature API Calendar
0.0.1-dev.1 Register extensions for the event editor registerEventEditorExtension –
0.0.1-dev.1 Add own fields to the event editor addField –
0.0.1-dev.1 Update the event before it is saved onSave –
0.0.1-dev.1 Set properties of the event setProperty –
  • Version: first version of this library with the feature. Unreleased versions are planned.
  • Calendar: first Calendar app version that implements the feature, – if none yet.

Contributing

See CONTRIBUTING.md.

License

AGPL-3.0-or-later

About

Nextcloud Calendar front-end API

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages