Weekly view if word is included in view name

This commit is contained in:
Cyril Fougeray 2020-11-07 17:41:36 +01:00
parent 06f4d7b519
commit 925f6439fe
2 changed files with 4 additions and 4 deletions

View File

@ -426,7 +426,7 @@ the font you would like to use, or leave it blank to not change anything.
**tags:** #extension **tags:** #extension
**description:** calendar views named "weekly" will show only the 7 days of this week. **description:** calendar views with the word "weekly" included in the name will show only the 7 days of this week.
**author:** [adihd](https://github.com/adihd/) **author:** [adihd](https://github.com/adihd/)

View File

@ -11,8 +11,8 @@ module.exports = {
id: '4c7acaea-6596-4590-85e5-8ac5a1455e8f', id: '4c7acaea-6596-4590-85e5-8ac5a1455e8f',
tags: ['extension'], tags: ['extension'],
name: 'weekly view', name: 'weekly view',
desc: 'calendar views named "weekly" will show only the 7 days of this week.', desc: 'calendar views with the word "weekly" included in the name will show only the 7 days of this week.',
version: '0.5.1', version: '0.5.2',
author: 'adihd', author: 'adihd',
hacks: { hacks: {
'renderer/preload.js'(store, __exports) { 'renderer/preload.js'(store, __exports) {
@ -31,7 +31,7 @@ module.exports = {
document document
.querySelectorAll('.notion-collection-view-select') .querySelectorAll('.notion-collection-view-select')
.forEach((collection_view) => { .forEach((collection_view) => {
if (collection_view.innerText.toLowerCase() !== 'weekly') return; if (collection_view.innerText.toLowerCase().indexOf('weekly') === -1) return;
const days = collection_view.parentElement.parentElement.parentElement.parentElement.getElementsByClassName( const days = collection_view.parentElement.parentElement.parentElement.parentElement.getElementsByClassName(
'notion-calendar-view-day' 'notion-calendar-view-day'
), ),