diff --git a/browser/src/Services/Snippets/SnippetVariableResolver.ts b/browser/src/Services/Snippets/SnippetVariableResolver.ts index efcf7806e1..e72ac929eb 100644 --- a/browser/src/Services/Snippets/SnippetVariableResolver.ts +++ b/browser/src/Services/Snippets/SnippetVariableResolver.ts @@ -20,18 +20,31 @@ export class SnippetVariableResolver implements VariableResolver { const filePath = this._buffer && this._buffer.filePath ? this._buffer.filePath : "" this._variableToValue = { - TM_LINE_INDEX: line.toString(), - TM_LINE_NUMBER: (line + 1).toString(), - TM_FILENAME: path.basename(filePath), - TM_DIRECTORY: path.dirname(filePath), - TM_FILEPATH: filePath, - TM_FILENAME_BASE: path.basename(filePath, path.extname(filePath)), CURRENT_YEAR: currentDate.getFullYear().toString(), - CURRENT_MONTH: currentDate.getMonth().toString(), + CURRENT_YEAR_SHORT: currentDate + .getFullYear() + .toString() + .slice(-2), + CURRENT_MONTH: (currentDate.getMonth() + 1).toString(), CURRENT_DATE: currentDate.getDate().toString(), CURRENT_HOUR: currentDate.getHours().toString(), CURRENT_MINUTE: currentDate.getMinutes().toString(), CURRENT_SECOND: currentDate.getSeconds().toString(), + CURRENT_DAY_NAME: currentDate.toLocaleString("en-US", { weekday: "long" }), + CURRENT_DAY_NAME_SHORT: currentDate.toLocaleString("en-US", { weekday: "short" }), + CURRENT_MONTH_NAME: currentDate.toLocaleString("en-US", { month: "long" }), + CURRENT_MONTH_NAME_SHORT: currentDate.toLocaleString("en-US", { month: "short" }), + // SELECTION: "", + // CLIPBOARD: "", + // TM_SELECTED_TEXT: "", + // TM_CURRENT_LINE: "", + // TM_CURRENT_WORD: "", + TM_LINE_INDEX: line.toString(), + TM_LINE_NUMBER: (line + 1).toString(), + TM_FILENAME: path.basename(filePath), + TM_FILENAME_BASE: path.basename(filePath, path.extname(filePath)), + TM_DIRECTORY: path.dirname(filePath), + TM_FILEPATH: filePath, } }