Skip to content

Beautiful, AI-native markdown IDE and LLM wiki

Use local time zone for {{date}} and date defaults (PRD-9654) (#7315)

Andrew Mikofalvy4b0fb80de4cf
diff --git a/.changeset/template-date-local-timezone.md b/.changeset/template-date-local-timezone.md
new file mode 100644
index 000000000..4831f8b3c
--- /dev/null
+++ b/.changeset/template-date-local-timezone.md
@@ -0,0 +1,5 @@
+---
+'@inkeep/open-knowledge': patch
+---
+
+`{{date}}` in templates now fills in today's date in the time zone of the computer running OpenKnowledge instead of UTC, and new date properties default to your local date.
diff --git a/docs/content/advanced/folders-and-templates.mdx b/docs/content/advanced/folders-and-templates.mdx
index e1dd1d060..d646f9927 100644
--- a/docs/content/advanced/folders-and-templates.mdx
+++ b/docs/content/advanced/folders-and-templates.mdx
@@ -52,7 +52,7 @@ When you create a new file, the **New file** dialog shows a **Start from** picke
A template body may use two placeholders, filled in automatically when a document is created:
-- `{{date}}`: today's date, in `YYYY-MM-DD` form.
+- `{{date}}`: today's date in the time zone of the computer running OpenKnowledge, in `YYYY-MM-DD` form. A self-hosted server uses its [`TZ` environment variable](/docs/remote-control/methods/docker#the-environment-surface).
- `{{user}}`: the display name of the person or agent creating the document.
```md title=".ok/templates/standup.md"
diff --git a/docs/content/remote-control/methods/docker.mdx b/docs/content/remote-control/methods/docker.mdx
index c75095b1d..3e99e4643 100644
--- a/docs/content/remote-control/methods/docker.mdx
+++ b/docs/content/remote-control/methods/docker.mdx
@@ -87,6 +87,7 @@ docker run --rm -p 8080:8080 -e OK_ALLOW_EXTERNAL=1 -v ok-data:/data open-knowle
| `OK_BIND` | `0.0.0.0` | Bind address list. On an IPv6-only network, use `::` instead. It also serves IPv4. Do not combine `0.0.0.0 ::` on one port because the listeners conflict. |
| `OK_ALLOW_EXTERNAL` | unset | Run-time exposure consent. Without it the interlock refuses to boot. |
| `OK_EXTERNAL_URL` | unset | The public origin the deployment is reached at. Required behind any real domain, or hostname requests are rejected with `403`. |
+| `TZ` | unset (UTC) | Time zone for the date `{{date}}` fills in when a document is created from a template, as an IANA name such as `America/Los_Angeles`. |
| `OK_IDLE_SHUTDOWN` | unset | Idle shutdown defaults to `off` on a non-loopback bind. Set a duration such as `30m` to turn it back on. |
Health endpoints for platform checks: `GET /healthz` (liveness) and `GET /readyz` (readiness).
diff --git a/packages/app/src/components/AddPropertyRow.add-property-focus.dom.test.tsx b/packages/app/src/components/AddPropertyRow.add-property-focus.dom.test.tsx
index e08174216..e64dbc324 100644
--- a/packages/app/src/components/AddPropertyRow.add-property-focus.dom.test.tsx
+++ b/packages/app/src/components/AddPropertyRow.add-property-focus.dom.test.tsx
@@ -4,7 +4,7 @@ import userEvent from '@testing-library/user-event';
import { useState } from 'react';
import { afterEach, describe, expect, test } from 'vitest';
import { type AddDraft, AddPropertyRow } from './FrontmatterRow';
-import { DEFAULT_VALUE_FOR_TYPE } from './PropertyWidgets';
+import { defaultValueForType } from './PropertyWidgets';
const TYPE_PICKER_LABEL: Record<FrontmatterType, string> = {
text: 'Text',
@@ -35,9 +35,7 @@ function PropertyPanelHarness({
draft={draft}
onChangeName={(name) => setDraft((p) => ({ ...p, name, error: null }))}
onChangeType={(type) => {
- const defaultValue =
- type === 'date' ? new Date().toISOString().slice(0, 10) : DEFAULT_VALUE_FOR_TYPE[type];
- setDraft((p) => ({ ...p, type, value: defaultValue, error: null }));
+ setDraft((p) => ({ ...p, type, value: defaultValueForType(type), error: null }));
}}
onChangeValue={(value) => setDraft((p) => ({ ...p, value }))}
onCommit={() => {}}
@@ -62,9 +60,7 @@ function FolderDefaultsHarness({
draft={draft}
onChangeName={(name) => setDraft((p) => ({ ...p, name, error: null }))}
onChangeType={(type) => {
- const defaultValue =
- type === 'date' ? new Date().toISOString().slice(0, 10) : DEFAULT_VALUE_FOR_TYPE[type];
- setDraft((p) => ({ ...p, type, value: defaultValue, error: null }));
+ setDraft((p) => ({ ...p, type, value: defaultValueForType(type), error: null }));
}}
onChangeValue={(value) => setDraft((p) => ({ ...p, value }))}
onCommit={() => {}}
diff --git a/packages/app/src/components/FolderPropertiesCard.tsx b/packages/app/src/components/FolderPropertiesCard.tsx
index f0e213ff0..a1ed94c09 100644
--- a/packages/app/src/components/FolderPropertiesCard.tsx
+++ b/packages/app/src/components/FolderPropertiesCard.tsx
@@ -15,11 +15,7 @@ import {
FrontmatterRow,
type RenameDraft,
} from '@/components/FrontmatterRow';
-import {
- coerceValue,
- DEFAULT_VALUE_FOR_TYPE,
- resolveWidgetType,
-} from '@/components/PropertyWidgets';
+import { coerceValue, defaultValueForType, resolveWidgetType } from '@/components/PropertyWidgets';
import { Button } from '@/components/ui/button';
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
import { Skeleton } from '@/components/ui/skeleton';
@@ -101,11 +97,7 @@ export function FolderPropertiesCard({ folderPath, state, onChange }: Props) {
function changeAddType(nextType: FrontmatterType) {
setAdding((prev) => {
if (!prev) return prev;
- const defaultValue =
- nextType === 'date'
- ? new Date().toISOString().slice(0, 10)
- : DEFAULT_VALUE_FOR_TYPE[nextType];
- return { ...prev, type: nextType, value: defaultValue, error: null };
+ return { ...prev, type: nextType, value: defaultValueForType(nextType), error: null };
});
}
diff --git a/packages/app/src/components/ObjectWidget.tsx b/packages/app/src/components/ObjectWidget.tsx
index 8e6bf80c6..6a69017fa 100644
--- a/packages/app/src/components/ObjectWidget.tsx
+++ b/packages/app/src/components/ObjectWidget.tsx
@@ -33,7 +33,7 @@ import {
type RenameDraft,
} from '@/components/FrontmatterRow';
import { describeError } from '@/components/frontmatter-error-utils';
-import { coerceValue, DEFAULT_VALUE_FOR_TYPE } from '@/components/PropertyWidgets';
+import { coerceValue, defaultValueForType } from '@/components/PropertyWidgets';
import { Button } from '@/components/ui/button';
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from '@/components/ui/collapsible';
@@ -150,11 +150,7 @@ export function ObjectWidget({ keyName, value, path, depth = 0 }: ObjectWidgetPr
function changeAddType(nextType: FrontmatterType) {
setAdding((prev) => {
if (!prev) return prev;
- const defaultValue =
- nextType === 'date'
- ? new Date().toISOString().slice(0, 10)
- : DEFAULT_VALUE_FOR_TYPE[nextType];
- return { ...prev, type: nextType, value: defaultValue, error: null };
+ return { ...prev, type: nextType, value: defaultValueForType(nextType), error: null };
});
}
diff --git a/packages/app/src/components/PropertyPanel.tsx b/packages/app/src/components/PropertyPanel.tsx
index f2c521bac..e1f2264da 100644
--- a/packages/app/src/components/PropertyPanel.tsx
+++ b/packages/app/src/components/PropertyPanel.tsx
@@ -45,7 +45,11 @@ import {
} from '@/components/FrontmatterRow';
import { useProperties } from '@/components/PropertyContext';
import { PropertyDisclosure } from '@/components/PropertyDisclosure';
-import { coerceValue, DEFAULT_VALUE_FOR_TYPE } from '@/components/PropertyWidgets';
+import {
+ coerceValue,
+ DEFAULT_VALUE_FOR_TYPE,
+ defaultValueForType,
+} from '@/components/PropertyWidgets';
import { usePropertiesCollapsed } from '@/components/properties-collapsed-store';
import { Button } from '@/components/ui/button';
import { useDocLintConfig } from '@/editor/lint-config-client';
@@ -244,10 +248,6 @@ export function PropertyPanel({ provider, reservedKeys, identitySlot }: Property
}
}
- function defaultValueFor(type: FrontmatterType): FrontmatterValue {
- return type === 'date' ? new Date().toISOString().slice(0, 10) : DEFAULT_VALUE_FOR_TYPE[type];
- }
-
function blankDraft(): StagedDraft {
blankDraftSeq.current += 1;
return {
@@ -319,7 +319,7 @@ export function PropertyPanel({ provider, reservedKeys, identitySlot }: Property
updateDraft(id, (draft) => ({
...draft,
type: nextType,
- value: defaultValueFor(nextType),
+ value: defaultValueForType(nextType),
error: null,
}));
}
@@ -337,7 +337,7 @@ export function PropertyPanel({ provider, reservedKeys, identitySlot }: Property
...draft,
name: suggestion.name,
type: suggestion.type,
- value: defaultValueFor(suggestion.type),
+ value: defaultValueForType(suggestion.type),
error: null,
}));
}
diff --git a/packages/app/src/components/PropertyWidgets.tsx b/packages/app/src/components/PropertyWidgets.tsx
index 2965be374..dc857398a 100644
--- a/packages/app/src/components/PropertyWidgets.tsx
+++ b/packages/app/src/components/PropertyWidgets.tsx
@@ -11,6 +11,7 @@ import {
FRONTMATTER_TAG_VALUE_RE,
isValidFrontmatterTagValue,
} from '@inkeep/open-knowledge-core/frontmatter/tags';
+import { localIsoDate } from '@inkeep/open-knowledge-core/utils/local-iso-date';
import type { MessageDescriptor } from '@lingui/core';
import { msg } from '@lingui/core/macro';
import { Trans, useLingui } from '@lingui/react/macro';
@@ -558,6 +559,10 @@ export const DEFAULT_VALUE_FOR_TYPE: Record<FrontmatterType, FrontmatterValue> =
object: {},
};
+export function defaultValueForType(type: FrontmatterType): FrontmatterValue {
+ return type === 'date' ? localIsoDate() : DEFAULT_VALUE_FOR_TYPE[type];
+}
+
interface TypeIconButtonProps {
keyName: string;
type: FrontmatterType;
@@ -668,8 +673,7 @@ export function coerceValue(value: FrontmatterValue, target: FrontmatterType): F
}
case 'date': {
if (typeof value === 'string' && /^\d{4}-\d{2}-\d{2}$/.test(value)) return value;
- const today = new Date().toISOString().slice(0, 10);
- return today;
+ return localIsoDate();
}
case 'list': {
if (Array.isArray(value)) return value;
diff --git a/packages/app/tests/integration/create-page.test.ts b/packages/app/tests/integration/create-page.test.ts
index 79072b6c9..d5789b964 100644
--- a/packages/app/tests/integration/create-page.test.ts
+++ b/packages/app/tests/integration/create-page.test.ts
@@ -1,6 +1,6 @@
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';
-import { afterAll, beforeAll, describe, expect, test } from 'vitest';
+import { afterAll, beforeAll, describe, expect, onTestFinished, test } from 'vitest';
import { HARNESS_BOOT_TIMEOUT_MS } from './harness-boot-timeout';
import { createTestServer, type TestServer } from './test-harness';
@@ -164,6 +164,35 @@ describe('/api/create-page — template seeding', () => {
expect(created).toMatch(/\d{4}-\d{2}-\d{2}/);
});
+ test('fills {{date}} with the local calendar date, not the UTC date', async () => {
+ const now = new Date();
+ const zone = now.getUTCHours() < 11 ? 'Etc/GMT+12' : 'Etc/GMT-14';
+ const localDate = new Intl.DateTimeFormat('en-CA', {
+ timeZone: zone,
+ year: 'numeric',
+ month: '2-digit',
+ day: '2-digit',
+ }).format(now);
+ expect(localDate).not.toBe(now.toISOString().slice(0, 10));
+
+ seedRootTemplate(
+ 'dated-tpl',
+ '---\ntemplate:\n title: Dated\ndate: {{date}}\n---\n# {{date}}\n',
+ );
+ const originalTz = process.env.TZ;
+ onTestFinished(() => {
+ if (originalTz === undefined) delete process.env.TZ;
+ else process.env.TZ = originalTz;
+ });
+ process.env.TZ = zone;
+ const { status } = await createPageWithTemplate('from-dated-tpl.md', 'dated-tpl');
+ expect(status).toBe(200);
+
+ const created = readFileSync(join(server.contentDir, 'from-dated-tpl.md'), 'utf-8');
+ expect(created).toContain(`date: ${localDate}`);
+ expect(created).toContain(`# ${localDate}`);
+ });
+
test('single-block template: strips `template:` identity, keeps doc-frontmatter, substitutes tokens', async () => {
seedRootTemplate(
'research-tpl',
diff --git a/packages/core/package.json b/packages/core/package.json
index e6c79b1c3..b2dcc47d8 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -755,6 +755,12 @@
"types": "./dist/utils-link-targets.d.mts",
"default": "./dist/utils-link-targets.mjs"
},
+ "./utils/local-iso-date": {
+ "@inkeep/source": "./src/utils/local-iso-date.ts",
+ "development": "./src/utils/local-iso-date.ts",
+ "types": "./dist/utils-local-iso-date.d.mts",
+ "default": "./dist/utils-local-iso-date.mjs"
+ },
"./utils/loom-embed": {
"@inkeep/source": "./src/utils/loom-embed.ts",
"development": "./src/utils/loom-embed.ts",
diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts
index 82738202e..4dde207b3 100644
--- a/packages/core/src/index.ts
+++ b/packages/core/src/index.ts
@@ -2200,6 +2200,7 @@ export {
type ResolveAssetProjectPathOptions,
resolveAssetProjectPath,
} from './utils/link-targets.ts';
+export { localIsoDate } from './utils/local-iso-date.ts';
export {
isLoomUrl,
type ParsedLoomUrl,
diff --git a/packages/core/src/utils/local-iso-date.test.ts b/packages/core/src/utils/local-iso-date.test.ts
new file mode 100644
index 000000000..b4154e83a
--- /dev/null
+++ b/packages/core/src/utils/local-iso-date.test.ts
@@ -0,0 +1,29 @@
+import { afterEach, beforeEach, describe, expect, it } from 'vitest';
+import { localIsoDate } from './local-iso-date.ts';
+
+describe('localIsoDate', () => {
+ let originalTz: string | undefined;
+
+ beforeEach(() => {
+ originalTz = process.env.TZ;
+ });
+
+ afterEach(() => {
+ if (originalTz === undefined) delete process.env.TZ;
+ else process.env.TZ = originalTz;
+ });
+
+ it('keeps the local date when UTC has already rolled over to the next day', () => {
+ process.env.TZ = 'America/Los_Angeles';
+ expect(localIsoDate(new Date('2026-10-19T00:15:00Z'))).toBe('2026-10-18');
+ });
+
+ it('advances to the local date when the local zone is ahead of UTC', () => {
+ process.env.TZ = 'Pacific/Kiritimati';
+ expect(localIsoDate(new Date('2026-10-18T12:00:00Z'))).toBe('2026-10-19');
+ });
+
+ it('zero-pads month and day', () => {
+ expect(localIsoDate(new Date(2026, 0, 9, 12))).toBe('2026-01-09');
+ });
+});
diff --git a/packages/core/src/utils/local-iso-date.ts b/packages/core/src/utils/local-iso-date.ts
new file mode 100644
index 000000000..38092c163
--- /dev/null
+++ b/packages/core/src/utils/local-iso-date.ts
@@ -0,0 +1,6 @@
+export function localIsoDate(now: Date = new Date()): string {
+ const yyyy = now.getFullYear().toString().padStart(4, '0');
+ const mm = (now.getMonth() + 1).toString().padStart(2, '0');
+ const dd = now.getDate().toString().padStart(2, '0');
+ return `${yyyy}-${mm}-${dd}`;
+}
diff --git a/packages/core/tests/contract/module-subpaths.test.ts b/packages/core/tests/contract/module-subpaths.test.ts
index dee8fa02c..238b5a9be 100644
--- a/packages/core/tests/contract/module-subpaths.test.ts
+++ b/packages/core/tests/contract/module-subpaths.test.ts
@@ -111,6 +111,7 @@ import * as utilsGraphemeClipSubpath from '@inkeep/open-knowledge-core/utils/gra
import * as utilsHeadingScanSubpath from '@inkeep/open-knowledge-core/utils/heading-scan';
import * as utilsIdentitySubpath from '@inkeep/open-knowledge-core/utils/identity';
import * as utilsLinkTargetsSubpath from '@inkeep/open-knowledge-core/utils/link-targets';
+import * as utilsLocalIsoDateSubpath from '@inkeep/open-knowledge-core/utils/local-iso-date';
import * as utilsLoomEmbedSubpath from '@inkeep/open-knowledge-core/utils/loom-embed';
import * as utilsPdfAnchorSubpath from '@inkeep/open-knowledge-core/utils/pdf-anchor';
import * as utilsRandomUuidSubpath from '@inkeep/open-knowledge-core/utils/random-uuid';
@@ -254,6 +255,7 @@ const MODULE_SUBPATHS: Record<string, object> = {
'./utils/heading-scan': utilsHeadingScanSubpath,
'./utils/identity': utilsIdentitySubpath,
'./utils/link-targets': utilsLinkTargetsSubpath,
+ './utils/local-iso-date': utilsLocalIsoDateSubpath,
'./utils/loom-embed': utilsLoomEmbedSubpath,
'./utils/pdf-anchor': utilsPdfAnchorSubpath,
'./utils/random-uuid': utilsRandomUuidSubpath,
diff --git a/packages/core/tests/contract/subpath-types/consumer.ts b/packages/core/tests/contract/subpath-types/consumer.ts
index a87e1a8e0..ae2381e56 100644
--- a/packages/core/tests/contract/subpath-types/consumer.ts
+++ b/packages/core/tests/contract/subpath-types/consumer.ts
@@ -799,6 +799,7 @@ export type {
isExternalHref,
resolveAssetProjectPath,
} from '@inkeep/open-knowledge-core/utils/link-targets';
+export type { localIsoDate } from '@inkeep/open-knowledge-core/utils/local-iso-date';
export type { isLoomUrl, parseLoomUrl } from '@inkeep/open-knowledge-core/utils/loom-embed';
export type { parsePdfAnchor } from '@inkeep/open-knowledge-core/utils/pdf-anchor';
export type { randomUUID } from '@inkeep/open-knowledge-core/utils/random-uuid';
diff --git a/packages/core/tsdown.config.ts b/packages/core/tsdown.config.ts
index 03ff0e997..1cb7f9042 100644
--- a/packages/core/tsdown.config.ts
+++ b/packages/core/tsdown.config.ts
@@ -126,6 +126,7 @@ const entry = {
'utils-heading-scan': 'src/utils/heading-scan.ts',
'utils-identity': 'src/utils/identity.ts',
'utils-link-targets': 'src/utils/link-targets.ts',
+ 'utils-local-iso-date': 'src/utils/local-iso-date.ts',
'utils-loom-embed': 'src/utils/loom-embed.ts',
'utils-pdf-anchor': 'src/utils/pdf-anchor.ts',
'utils-random-uuid': 'src/utils/random-uuid.ts',
diff --git a/packages/server/src/content/substitution.test.ts b/packages/server/src/content/substitution.test.ts
index 51e6dbdc3..07956635a 100644
--- a/packages/server/src/content/substitution.test.ts
+++ b/packages/server/src/content/substitution.test.ts
@@ -1,10 +1,5 @@
import { describe, expect, it } from 'vitest';
-import {
- applySubstitution,
- SUBSTITUTION_ALLOWLIST,
- todayIsoUtc,
- validateSubstitution,
-} from './substitution.ts';
+import { applySubstitution, SUBSTITUTION_ALLOWLIST, validateSubstitution } from './substitution.ts';
describe('SUBSTITUTION_ALLOWLIST', () => {
it('contains the two v1 tokens', () => {
@@ -88,17 +83,3 @@ describe('applySubstitution', () => {
);
});
});
-
-describe('todayIsoUtc', () => {
- it('formats a fixed UTC date as YYYY-MM-DD', () => {
- expect(todayIsoUtc(new Date('2026-05-03T12:00:00Z'))).toBe('2026-05-03');
- });
-
- it('zero-pads month and day', () => {
- expect(todayIsoUtc(new Date('2026-01-09T00:00:00Z'))).toBe('2026-01-09');
- });
-
- it('uses UTC, not local time', () => {
- expect(todayIsoUtc(new Date('2026-01-01T00:30:00Z'))).toBe('2026-01-01');
- });
-});
diff --git a/packages/server/src/content/substitution.ts b/packages/server/src/content/substitution.ts
index 9d2339b76..fc3b3a504 100644
--- a/packages/server/src/content/substitution.ts
+++ b/packages/server/src/content/substitution.ts
@@ -36,10 +36,3 @@ export function applySubstitution(body: string, ctx: SubstitutionContext): strin
function isAllowedToken(token: string): token is SubstitutionToken {
return (SUBSTITUTION_ALLOWLIST as readonly string[]).includes(token);
}
-
-export function todayIsoUtc(now: Date = new Date()): string {
- const yyyy = now.getUTCFullYear().toString().padStart(4, '0');
- const mm = (now.getUTCMonth() + 1).toString().padStart(2, '0');
- const dd = now.getUTCDate().toString().padStart(2, '0');
- return `${yyyy}-${mm}-${dd}`;
-}
diff --git a/packages/server/src/http/file-ops-routes.ts b/packages/server/src/http/file-ops-routes.ts
index 746a1a091..0b69dec81 100644
--- a/packages/server/src/http/file-ops-routes.ts
+++ b/packages/server/src/http/file-ops-routes.ts
@@ -22,6 +22,7 @@ import {
instantiateDoc,
isManagedArtifactDocName,
LINKABLE_ASSET_EXTENSIONS,
+ localIsoDate,
type Principal,
type ProblemType,
RenamePathRequestSchema,
@@ -40,7 +41,7 @@ import { isConfigDoc, isSystemDoc } from '../cc1-broadcast.ts';
import type { ConflictAuthority } from '../conflict-authority.ts';
import { DocInConflictError, respondDocInConflict } from '../conflict-errors.ts';
import { isReservedProjectStatePath } from '../content/managed-doc-enum.ts';
-import { applySubstitution, todayIsoUtc } from '../content/substitution.ts';
+import { applySubstitution } from '../content/substitution.ts';
import { resolveTemplatesAvailable } from '../content/templates-resolver.ts';
import type { ContentFilter } from '../content-filter.ts';
import { recordContributor } from '../contributor-tracker.ts';
@@ -597,7 +598,7 @@ export function createFileOpsRoutes(deps: FileOpsRouteDeps): ApiRouteGroup {
const userDisplayName =
actor.kind === 'agent' || actor.kind === 'principal' ? (actor.displayName ?? '') : '';
initialContent = applySubstitution(templateStarter, {
- date: todayIsoUtc(),
+ date: localIsoDate(),
user: userDisplayName,
});
templateScopeForLog = matched.scope;
diff --git a/packages/server/src/mcp/tools/write.ts b/packages/server/src/mcp/tools/write.ts
index 96e40f3c1..05ced0631 100644
--- a/packages/server/src/mcp/tools/write.ts
+++ b/packages/server/src/mcp/tools/write.ts
@@ -6,6 +6,7 @@ import {
type FrontmatterPatch,
findTemplateByName,
instantiateDoc,
+ localIsoDate,
normalizeBridge,
type ProblemType,
parseFrontmatterYaml,
@@ -26,7 +27,7 @@ import { CONCURRENT_OVERWRITE_REFUSED_TYPE } from '../../concurrent-overwrite-re
import { resolveContentDir, resolveLockDir } from '../../config/paths.ts';
import { mergePatch } from '../../content/frontmatter-merge.ts';
import { parentFolderOf } from '../../content/nested-folder-rules.ts';
-import { applySubstitution, todayIsoUtc } from '../../content/substitution.ts';
+import { applySubstitution } from '../../content/substitution.ts';
import { resolveTemplatesAvailable } from '../../content/templates-resolver.ts';
import type { LocalApiDispatch } from '../../http/local-api-dispatch.ts';
import { splitPayloadFrontmatter } from '../../payload-frontmatter.ts';
@@ -318,7 +319,7 @@ async function writeOneDoc(
}
const templateBody = instantiateDoc(templateContent);
effectiveMarkdown = applySubstitution(templateBody, {
- date: todayIsoUtc(),
+ date: localIsoDate(),
user: identity?.displayName ?? '',
});
effectivePosition = 'replace';