imdone-core 1.40.0 → 1.40.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/card.js +4 -2
- package/lib/file.js +4 -3
- package/package.json +1 -1
package/lib/card.js
CHANGED
|
@@ -6,6 +6,7 @@ const _isFunction = require('lodash.isfunction')
|
|
|
6
6
|
const _isEmpty = require('lodash.isempty')
|
|
7
7
|
const _get = require('lodash.get')
|
|
8
8
|
const eol = require('eol')
|
|
9
|
+
const moment = require('moment')
|
|
9
10
|
const allEmoji = require('markdown-it-emoji/lib/data/full.json')
|
|
10
11
|
|
|
11
12
|
const { removeMD, renderMarkdown } = require('./adapters/markdown')
|
|
@@ -115,6 +116,7 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
115
116
|
|
|
116
117
|
get defaultData() {
|
|
117
118
|
return {
|
|
119
|
+
timestamp: moment().format(),
|
|
118
120
|
..._pick(
|
|
119
121
|
this,
|
|
120
122
|
...['beforeText',
|
|
@@ -186,10 +188,10 @@ module.exports = function newCard(task, _project, dontParse) {
|
|
|
186
188
|
? { ...pluginManager.getCardProperties(defaultData) }
|
|
187
189
|
: {}
|
|
188
190
|
const data = {
|
|
189
|
-
...defaultData,
|
|
190
191
|
...pluginData,
|
|
191
192
|
...props,
|
|
192
|
-
...computed
|
|
193
|
+
...computed,
|
|
194
|
+
...defaultData
|
|
193
195
|
}
|
|
194
196
|
|
|
195
197
|
this.data = { ...data }
|
package/lib/file.js
CHANGED
|
@@ -20,6 +20,7 @@ var _clone = require('lodash.clone'),
|
|
|
20
20
|
newCard = require('./card'),
|
|
21
21
|
fastSort = require('fast-sort/dist/sort'),
|
|
22
22
|
XRegExp = require('xregexp'),
|
|
23
|
+
moment = require('moment'),
|
|
23
24
|
{
|
|
24
25
|
FILE_TYPES,
|
|
25
26
|
getTaskContent,
|
|
@@ -148,7 +149,7 @@ File.addCompleted = function ({ task, content, config }) {
|
|
|
148
149
|
if (task.list !== doneList) return content
|
|
149
150
|
if (task.completed || task.meta.completed) return content
|
|
150
151
|
if (content.includes(`completed${config.getMetaSep()}`)) return content
|
|
151
|
-
const now =
|
|
152
|
+
const now = moment().format()
|
|
152
153
|
content = task.addToLastCommentInContent(
|
|
153
154
|
content,
|
|
154
155
|
`completed${config.getMetaSep()}${now}`,
|
|
@@ -165,7 +166,7 @@ File.parseDueDate = function (config, text) {
|
|
|
165
166
|
if (dueString) return dueMatch
|
|
166
167
|
try {
|
|
167
168
|
const due = chrono.parseDate(dueMatch, new Date(), {forwardDate: true})
|
|
168
|
-
dueString = due.
|
|
169
|
+
dueString = moment(due).format()
|
|
169
170
|
return `${p1.toLowerCase()}${config.getMetaSep()}${dueString}`
|
|
170
171
|
} catch (e) {
|
|
171
172
|
// console.log(`Unable to parse due date for ${text}`)
|
|
@@ -832,7 +833,7 @@ File.prototype.modifyDescription = function (task, config) {
|
|
|
832
833
|
if (
|
|
833
834
|
this.isMarkDownFile() &&
|
|
834
835
|
description.length > 0 &&
|
|
835
|
-
(
|
|
836
|
+
(hasBlankLines(description) || isWrappedWithCardTag || trailingBlankLines)
|
|
836
837
|
) {
|
|
837
838
|
task.isWrappedWithCardTag = isWrappedWithCardTag // DOING Find out where this is used and stop using it
|
|
838
839
|
// <!-- order:-30 -->
|