Insert DateTime
This commit is contained in:
@ -87,4 +87,9 @@ None
|
|||||||
## 1.4.1
|
## 1.4.1
|
||||||
-----------------------------------------------------------------------------------------------------------
|
-----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
- new yo code template
|
- new yo code template
|
||||||
|
|
||||||
|
## 1.4.2
|
||||||
|
-----------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
- Insert date time
|
4
type-script-helper/package-lock.json
generated
4
type-script-helper/package-lock.json
generated
@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "type-script-helper",
|
"name": "type-script-helper",
|
||||||
"version": "0.0.1",
|
"version": "1.4.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "type-script-helper",
|
"name": "type-script-helper",
|
||||||
"version": "0.0.1",
|
"version": "1.4.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vscode/vsce": "^2.19.0"
|
"@vscode/vsce": "^2.19.0"
|
||||||
},
|
},
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
"description": "Helper for VS Code in TypeScript",
|
"description": "Helper for VS Code in TypeScript",
|
||||||
"publisher": "IFX",
|
"publisher": "IFX",
|
||||||
"repository": "https://github.com/mikepharesjr/YO-VSCode/tree/master/type-script-helper",
|
"repository": "https://github.com/mikepharesjr/YO-VSCode/tree/master/type-script-helper",
|
||||||
"version": "1.4.1",
|
"version": "1.4.2",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.79.0"
|
"vscode": "^1.79.0"
|
||||||
},
|
},
|
||||||
@ -51,6 +51,10 @@
|
|||||||
"command": "replaceLinesHelper.expandSql",
|
"command": "replaceLinesHelper.expandSql",
|
||||||
"title": "Expand Sql"
|
"title": "Expand Sql"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"command": "replaceLinesHelper.insertDateTime",
|
||||||
|
"title": "Insert DateTime"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"command": "replaceLinesHelper.listToListFamily",
|
"command": "replaceLinesHelper.listToListFamily",
|
||||||
"title": "List to list family (Kristy, Mike ...)"
|
"title": "List to list family (Kristy, Mike ...)"
|
||||||
|
@ -33,6 +33,7 @@ export function activate(context: vscode.ExtensionContext) {
|
|||||||
vscode.commands.registerCommand('replaceLinesHelper.cutEachLine', replaceLinesHelper.cutEachLine),
|
vscode.commands.registerCommand('replaceLinesHelper.cutEachLine', replaceLinesHelper.cutEachLine),
|
||||||
vscode.commands.registerCommand('replaceLinesHelper.distinctLines', replaceLinesHelper.distinctLines),
|
vscode.commands.registerCommand('replaceLinesHelper.distinctLines', replaceLinesHelper.distinctLines),
|
||||||
vscode.commands.registerCommand('replaceLinesHelper.expandSql', replaceLinesHelper.expandSql),
|
vscode.commands.registerCommand('replaceLinesHelper.expandSql', replaceLinesHelper.expandSql),
|
||||||
|
vscode.commands.registerCommand('replaceLinesHelper.insertDateTime', replaceLinesHelper.insertDateTime),
|
||||||
vscode.commands.registerCommand('replaceLinesHelper.listToListFamily', replaceLinesHelper.listToListFamily),
|
vscode.commands.registerCommand('replaceLinesHelper.listToListFamily', replaceLinesHelper.listToListFamily),
|
||||||
vscode.commands.registerCommand('replaceLinesHelper.listToListWrappedComma', replaceLinesHelper.listToListWrappedComma),
|
vscode.commands.registerCommand('replaceLinesHelper.listToListWrappedComma', replaceLinesHelper.listToListWrappedComma),
|
||||||
vscode.commands.registerCommand('replaceLinesHelper.prettySql', replaceLinesHelper.prettySql),
|
vscode.commands.registerCommand('replaceLinesHelper.prettySql', replaceLinesHelper.prettySql),
|
||||||
|
@ -10,6 +10,7 @@ enum LinesAction {
|
|||||||
cutEachLine,
|
cutEachLine,
|
||||||
distinctLines,
|
distinctLines,
|
||||||
expandSql,
|
expandSql,
|
||||||
|
insertDateTime,
|
||||||
listToListFamily,
|
listToListFamily,
|
||||||
listToListWrappedComma,
|
listToListWrappedComma,
|
||||||
prettySql,
|
prettySql,
|
||||||
@ -118,6 +119,13 @@ function expandSqlLogic(lines: string[]): void {
|
|||||||
prettySqlLogic(lines);
|
prettySqlLogic(lines);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function insertDateTimeLogic(lines: string[]): void {
|
||||||
|
const date = new Date();
|
||||||
|
for (let i = 0; i < lines.length; ++i) {
|
||||||
|
lines[i] = date.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function listToListFamilyLogic(lines: string[]): void {
|
function listToListFamilyLogic(lines: string[]): void {
|
||||||
for (let i = 0; i < lines.length; ++i) {
|
for (let i = 0; i < lines.length; ++i) {
|
||||||
lines[i] = "Kristy" + lines[i].trim() + "Mike" + lines[i].trim() + "Jason" + lines[i].trim() + "Mackenzie" + lines[i].trim() + "Logan" + lines[i].trim() + "Lilly" + lines[i].trim() + "Chelsea" + lines[i].trim() + "Piper" + lines[i].trim();
|
lines[i] = "Kristy" + lines[i].trim() + "Mike" + lines[i].trim() + "Jason" + lines[i].trim() + "Mackenzie" + lines[i].trim() + "Logan" + lines[i].trim() + "Lilly" + lines[i].trim() + "Chelsea" + lines[i].trim() + "Piper" + lines[i].trim();
|
||||||
@ -402,6 +410,7 @@ function linesFunction(linesAction: LinesAction): Thenable<boolean> | undefined
|
|||||||
case LinesAction.cutEachLine: { cutEachLineLogic(lines); break; }
|
case LinesAction.cutEachLine: { cutEachLineLogic(lines); break; }
|
||||||
case LinesAction.distinctLines: { distinctLinesLogic(lines); break; }
|
case LinesAction.distinctLines: { distinctLinesLogic(lines); break; }
|
||||||
case LinesAction.expandSql: { expandSqlLogic(lines); break; }
|
case LinesAction.expandSql: { expandSqlLogic(lines); break; }
|
||||||
|
case LinesAction.insertDateTime: { insertDateTimeLogic(lines); break; }
|
||||||
case LinesAction.listToListFamily: { listToListFamilyLogic(lines); break; }
|
case LinesAction.listToListFamily: { listToListFamilyLogic(lines); break; }
|
||||||
case LinesAction.listToListWrappedComma: { listToListWrappedCommaLogic(lines); break; }
|
case LinesAction.listToListWrappedComma: { listToListWrappedCommaLogic(lines); break; }
|
||||||
case LinesAction.prettySql: { prettySqlLogic(lines); break; }
|
case LinesAction.prettySql: { prettySqlLogic(lines); break; }
|
||||||
@ -428,6 +437,7 @@ export const convertToRegularExpression = () => linesFunction(LinesAction.conver
|
|||||||
export const cutEachLine = () => linesFunction(LinesAction.cutEachLine);
|
export const cutEachLine = () => linesFunction(LinesAction.cutEachLine);
|
||||||
export const distinctLines = () => linesFunction(LinesAction.distinctLines);
|
export const distinctLines = () => linesFunction(LinesAction.distinctLines);
|
||||||
export const expandSql = () => linesFunction(LinesAction.expandSql);
|
export const expandSql = () => linesFunction(LinesAction.expandSql);
|
||||||
|
export const insertDateTime = () => linesFunction(LinesAction.insertDateTime);
|
||||||
export const listToListFamily = () => linesFunction(LinesAction.listToListFamily);
|
export const listToListFamily = () => linesFunction(LinesAction.listToListFamily);
|
||||||
export const listToListWrappedComma = () => linesFunction(LinesAction.listToListWrappedComma);
|
export const listToListWrappedComma = () => linesFunction(LinesAction.listToListWrappedComma);
|
||||||
export const prettySql = () => linesFunction(LinesAction.prettySql);
|
export const prettySql = () => linesFunction(LinesAction.prettySql);
|
||||||
|
Reference in New Issue
Block a user