Skip to content

Commit abef58a

Browse files
authored
Merge pull request #1270 from pjkaufman/master
Fix UTC Not Properly Handled by YAML Timestamp When Format is Not Expected Format But Is UTC
2 parents 1f62de7 + 9f76ed2 commit abef58a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

__tests__/remove-multiple-spaces.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ ruleTest({
240240
`,
241241
},
242242
{ // accounts for https://github.com/platers/obsidian-linter/issues/1203
243-
testName: 'A nested callout/blockquote should not have list item proceeding space removed',
243+
testName: 'Make sure that remove multiple spaces works when it comes right after a list with a sublist in it',
244244
before: dedent`
245245
- first item
246246
- xxxxxxxxxxxxxxxxxxxxxxxxx

src/rules/yaml-timestamp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export default class YamlTimestamp extends RuleBuilder<YamlTimestampOptions> {
204204
date.locale(locale);
205205

206206
const formattedDateStr = utc ? date.utc().format(format) : date.format(format);
207-
return moment(formattedDateStr, format, locale, true);
207+
return utc ? moment.utc(formattedDateStr, format, locale, true): moment(formattedDateStr, format, locale, true);
208208
}
209209

210210
return null;

0 commit comments

Comments
 (0)