-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67553fd
commit cc8d5ae
Showing
3 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script> | ||
export default { | ||
name: 'VoteCalendarLink', | ||
methods: { | ||
newEvent(option) { | ||
const dateTimeStart = option.timestamp | ||
const dateTimeEnd = moment.unix(dateTimeStart).add(1, 'hour').unix() | ||
const protocol = window.location.protocol + '//' | ||
const host = window.location.host | ||
// Useful if the current pathname is '/index.php/apps/...' | ||
const pathname = window.location.pathname.match('^(.*?/apps)/.*$') | ||
const appsRoot = pathname ? pathname[1] : '/apps' | ||
const calendarRoot = appsRoot + '/calendar' | ||
const calendarView = 'timeGridWeek' // timeGridDay, 'timeGridWeek' or 'dayGridMonth' | ||
const calendarTimeRange = moment.unix(dateTimeStart).format('Y-MM-DD') // 'now' or 'yyyy-mm-dd' | ||
const calendarAction = 'new' | ||
const calendarMode = 'sidebar' // 'popover' or 'sidebar' | ||
const calendarIsAllDay = '0' | ||
const calendarUrl = protocol + host + calendarRoot + '/' + calendarView + '/' + calendarTimeRange + '/' + calendarAction + '/' + calendarMode + '/' + calendarIsAllDay + '/' + dateTimeStart + '/' + dateTimeEnd | ||
return calendarUrl | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters