How to use the duration function from dayjs
Find comprehensive JavaScript dayjs.duration code examples handpicked from public code repositorys.
122 123 124 125 126 127 128 129 130 131
await datasetUtils.updateStorage(db, dataset) } // manage history TTL if (dataset.rest.historyTTL && dataset.rest.historyTTL.active && dataset.rest.historyTTL.delay && dataset.rest.historyTTL.delay.value) { const expireAfterSeconds = dayjs.duration(dataset.rest.historyTTL.delay.value, dataset.rest.historyTTL.delay.unit || 'days').asSeconds() await revisionsCollection.createIndex({ _updatedAt: 1 }, { expireAfterSeconds, name: 'history-ttl' }) } else { try { await revisionsCollection.dropIndex('history-ttl')
6
26
4
+ 4 other calls in file
GitHub: akablc/my-rss
4 5 6 7 8 9 10 11 12 13 14 15
const { fallback, queryToBoolean } = require('@/utils/readable-social'); const titleRegex = /(.+)\s+is\s+([A-Z]+)\s+\((.+)\)/; const formatTime = (s) => { const duration = dayjs.duration(s - 0, 'seconds'); const days = duration.days(); const hours = duration.hours(); const minutes = duration.minutes(); const seconds = duration.seconds();
0
0
1
+ 4 other calls in file