Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
611 changes: 88 additions & 523 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@
"@nextcloud/initial-state": "3.0.0",
"@nextcloud/l10n": "^3.4.1",
"@nextcloud/logger": "^3.0.3",
"@nextcloud/moment": "^1.3.5",
"@nextcloud/router": "^3.1.0",
"@nextcloud/vue": "9.3.1",
"@vueuse/components": "^14.0.0",
"color-convert": "^3.1.3",
"dayjs": "^1.11.19",
"debounce": "^3.0.0",
"ical.js": "^2.2.0",
"markdown-it": "^14.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/AppNavigation/AppNavigationSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ License along with this library. If not, see <http://www.gnu.org/licenses/>.

<script>
import { translate as t } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import dayjs from 'dayjs'
import NcAppNavigationSettings from '@nextcloud/vue/components/NcAppNavigationSettings'

import CalendarToday from 'vue-material-design-icons/CalendarToday.vue'
Expand Down Expand Up @@ -102,7 +102,7 @@ export default {
name: t('tasks', 'Automatic'),
},
],
dayOfMonth: moment().date(),
dayOfMonth: dayjs().date(),
}
},
computed: {
Expand Down
1 change: 0 additions & 1 deletion src/components/AppNavigation/Trashbin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ import { sort } from '../../store/storeHelper.js'

import { showError } from '@nextcloud/dialogs'
import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import NcAppNavigationItem from '@nextcloud/vue/components/NcAppNavigationItem'
import NcActions from '@nextcloud/vue/components/NcActions'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
Expand Down
6 changes: 3 additions & 3 deletions src/components/HeaderBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ import SortorderDropdown from './SortorderDropdown.vue'
import openNewTask from '../mixins/openNewTask.js'

import { translate as t } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import dayjs from 'dayjs'
import NcTextField from '@nextcloud/vue/components/NcTextField'

import Plus from 'vue-material-design-icons/Plus.vue'
Expand Down Expand Up @@ -140,11 +140,11 @@ export default {
}
if (this.$route.params.collectionId === 'today'
|| this.$route.params.collectionId === 'week') {
taskProperties.due = moment().startOf('day').format('YYYY-MM-DDTHH:mm:ss')
taskProperties.due = dayjs().startOf('day').format('YYYY-MM-DDTHH:mm:ss')
taskProperties.allDay = this.$store.state.settings.settings.allDay
}
if (this.$route.params.collectionId === 'current') {
taskProperties.start = moment().format('YYYY-MM-DDTHH:mm:ss')
taskProperties.start = dayjs().format('YYYY-MM-DDTHH:mm:ss')
}
return taskProperties
},
Expand Down
6 changes: 3 additions & 3 deletions src/components/TaskBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ import { startDateString } from '../utils/dateStrings.js'

import { emit } from '@nextcloud/event-bus'
import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import dayjs from 'dayjs'
import NcActions from '@nextcloud/vue/components/NcActions'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
import NcProgressBar from '@nextcloud/vue/components/NcProgressBar'
Expand Down Expand Up @@ -694,10 +694,10 @@ export default {
taskProperties.priority = '1'
}
if (this.collectionId === 'today') {
taskProperties.due = moment().startOf('day').format('YYYY-MM-DDTHH:mm:ss')
taskProperties.due = dayjs().startOf('day').format('YYYY-MM-DDTHH:mm:ss')
}
if (this.collectionId === 'current') {
taskProperties.start = moment().format('YYYY-MM-DDTHH:mm:ss')
taskProperties.start = dayjs().format('YYYY-MM-DDTHH:mm:ss')
}
return taskProperties
},
Expand Down
2 changes: 0 additions & 2 deletions src/models/task.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
*
*/

import moment from '@nextcloud/moment'

import ICAL from 'ical.js'
import { randomUUID } from '../utils/crypto.js'

Expand Down
18 changes: 9 additions & 9 deletions src/store/storeHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import Task from '../models/task.js'

import moment from '@nextcloud/moment'
import dayjs from 'dayjs'

import ICAL from 'ical.js'

Expand Down Expand Up @@ -105,7 +105,7 @@ function isTaskPriority(task) {
* @return {boolean}
*/
function isTaskCurrent(task) {
return !task.startMoment.isValid() || task.startMoment.diff(moment(), 'days', true) < 0 || task.dueMoment.diff(moment(), 'days', true) < 0
return !task.startMoment.isValid() || task.startMoment.diff(dayjs(), 'days', true) < 0 || task.dueMoment.diff(dayjs(), 'days', true) < 0
}

/**
Expand All @@ -125,7 +125,7 @@ function isTaskToday(task) {
* @return {boolean}
*/
function today(date) {
return date.isValid() && date.diff(moment().startOf('day'), 'days', true) < 1
return date.isValid() && date.diff(dayjs().startOf('day'), 'days', true) < 1
}

/**
Expand All @@ -145,7 +145,7 @@ function isTaskWeek(task) {
* @return {boolean}
*/
function week(date) {
return date.isValid() && date.diff(moment().startOf('day'), 'days', true) < 7
return date.isValid() && date.diff(dayjs().startOf('day'), 'days', true) < 7
}

/**
Expand Down Expand Up @@ -174,19 +174,19 @@ function dayOfTask(task) {

// Add all tasks whose start date will be reached at that day.
if (start.isValid() && !due.isValid()) {
diff = start.diff(moment().startOf('day'), 'days')
diff = start.diff(dayjs().startOf('day'), 'days')
}

// Add all tasks whose due date will be reached at that day.
if (due.isValid() && !start.isValid()) {
diff = due.diff(moment().startOf('day'), 'days')
diff = due.diff(dayjs().startOf('day'), 'days')
}

// Add all tasks whose due or start date will be reached at that day.
// Add the task to the day at which either due or start date are reached first.
if (start.isValid() && due.isValid()) {
startdiff = start.diff(moment().startOf('day'), 'days')
duediff = due.diff(moment().startOf('day'), 'days')
startdiff = start.diff(dayjs().startOf('day'), 'days')
duediff = due.diff(dayjs().startOf('day'), 'days')
// chose the date that is reached first
diff = (startdiff < duediff) ? startdiff : duediff
}
Expand All @@ -201,7 +201,7 @@ function dayOfTask(task) {
* @return {boolean}
*/
function overdue(date) {
return date.isValid() && date.diff(moment()) < 0
return date.isValid() && date.diff(dayjs()) < 0
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/store/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import Task from '../models/task.js'
import { showError } from '@nextcloud/dialogs'
import { emit } from '@nextcloud/event-bus'
import { translate as t } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import dayjs from 'dayjs'

import ICAL from 'ical.js'

Expand Down Expand Up @@ -1433,12 +1433,12 @@ const actions = {
async setDate(context, { task, day }) {
const start = task.startMoment.startOf('day')
const due = task.dueMoment.startOf('day')
day = moment().startOf('day').add(day, 'days')
day = dayjs().startOf('day').add(day, 'days')

let diff
// Adjust start date
if (start.isValid()) {
diff = start.diff(moment().startOf('day'), 'days')
diff = start.diff(dayjs().startOf('day'), 'days')
diff = diff < 0 ? 0 : diff
if (diff !== day) {
const newStart = task.startMoment.year(day.year()).month(day.month()).date(day.date())
Expand All @@ -1447,7 +1447,7 @@ const actions = {
}
// Adjust due date
} else if (due.isValid()) {
diff = due.diff(moment().startOf('day'), 'days')
diff = due.diff(dayjs().startOf('day'), 'days')
diff = diff < 0 ? 0 : diff
if (diff !== day) {
const newDue = task.dueMoment.year(day.year()).month(day.month()).date(day.date())
Expand Down
4 changes: 2 additions & 2 deletions src/utils/alarms.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import moment from '@nextcloud/moment'
import dayjs from 'dayjs'

/**
* Get the factor for a given unit
Expand Down Expand Up @@ -215,7 +215,7 @@ export function getDefaultAlarms(allDay = false) {
*/
export function getDefaultAbsoluteAlarms() {
return [
moment().add(1, 'day').startOf('day').add(9, 'hours').toDate(),
dayjs().add(1, 'day').startOf('day').add(9, 'hours').toDate(),
]
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/dateStrings.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/

import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import dayjs from 'dayjs'
import { convertTimeZone } from './alarms.js'

/**
Expand Down
4 changes: 2 additions & 2 deletions src/views/AppContent/Week.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import { isTaskInList } from '../../store/storeHelper.js'
import './task-list.scss'

import { translate as t } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import dayjs from 'dayjs'

import { mapGetters } from 'vuex'

Expand Down Expand Up @@ -89,7 +89,7 @@ export default {
},
methods: {
dayString(day) {
const date = moment().add(day, 'day')
const date = dayjs().add(day, 'day')
let dayString
if (day === 0) {
dayString = t('tasks', 'Today')
Expand Down
6 changes: 3 additions & 3 deletions src/views/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ import { startDateString, dueDateString } from '../utils/dateStrings.js'

import { subscribe, unsubscribe } from '@nextcloud/event-bus'
import { translate as t, translatePlural as n } from '@nextcloud/l10n'
import moment from '@nextcloud/moment'
import dayjs from 'dayjs'
import NcActionButton from '@nextcloud/vue/components/NcActionButton'
import NcActionLink from '@nextcloud/vue/components/NcActionLink'
import NcEmptyContent from '@nextcloud/vue/components/NcEmptyContent'
Expand Down Expand Up @@ -539,7 +539,7 @@ export default {
return start.toDate()
}
const due = this.task.dueMoment
let reference = moment().add(1, 'h')
let reference = dayjs().add(1, 'h')
if (due.isBefore(reference)) {
reference = due.subtract(1, 'm')
}
Expand All @@ -558,7 +558,7 @@ export default {
return due.toDate()
}
const start = this.task.startMoment
const reference = start.isAfter() ? start : moment()
const reference = start.isAfter() ? start : dayjs()
if (this.allDay) {
reference.startOf('day').add(1, 'd')
} else {
Expand Down