1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Mobile: Fixes #11539: Fix missing "Insert Time" button (#11542)

This commit is contained in:
Henry Heino
2025-01-06 02:52:43 -08:00
committed by GitHub
parent 70756760f5
commit 1bc6655d43
6 changed files with 38 additions and 7 deletions

View File

@ -0,0 +1,20 @@
import { CommandRuntime, CommandDeclaration, CommandContext } from '@joplin/lib/services/CommandService';
import { _ } from '@joplin/lib/locale';
import { CommandRuntimeProps } from '../types';
import time from '@joplin/lib/time';
export const declaration: CommandDeclaration = {
name: 'insertDateTime',
label: () => _('Insert time'),
iconName: 'material calendar-plus',
};
export const runtime = (props: CommandRuntimeProps): CommandRuntime => {
return {
execute: async (_context: CommandContext) => {
props.insertText(time.formatDateToLocal(new Date()));
},
enabledCondition: '!noteIsReadOnly',
};
};