File tree 2 files changed +8
-2
lines changed
2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ export interface ICodeSnippetEditorMetadata {
48
48
selectedTags : string [ ] ;
49
49
allTags : string [ ] ;
50
50
fromScratch : boolean ;
51
+ date_created : string ;
52
+ date_modified : string ;
51
53
}
52
54
53
55
export class CodeSnippetEditor extends ReactWidget {
@@ -389,6 +391,7 @@ export class CodeSnippetEditor extends ReactWidget {
389
391
this . _codeSnippetEditorMetaData . name = name ;
390
392
this . _codeSnippetEditorMetaData . description = description ;
391
393
this . _codeSnippetEditorMetaData . language = language ;
394
+ this . _codeSnippetEditorMetaData . date_modified = new Date ( ) . toLocaleString ( ) ;
392
395
393
396
const newPath =
394
397
'snippets/' + this . _codeSnippetEditorMetaData . name + '.json' ;
@@ -444,7 +447,9 @@ export class CodeSnippetEditor extends ReactWidget {
444
447
language : this . _codeSnippetEditorMetaData . language ,
445
448
code : this . _codeSnippetEditorMetaData . code ,
446
449
id : this . _codeSnippetEditorMetaData . id ,
447
- tags : this . _codeSnippetEditorMetaData . selectedTags
450
+ tags : this . _codeSnippetEditorMetaData . selectedTags ,
451
+ date_created : this . _codeSnippetEditorMetaData . date_created ,
452
+ date_modified : this . _codeSnippetEditorMetaData . date_modified
448
453
} )
449
454
} ) ;
450
455
Original file line number Diff line number Diff line change @@ -99,7 +99,8 @@ export function CodeSnippetInputDialog(
99
99
code : code ,
100
100
id : idx ,
101
101
tags : tags ,
102
- date_created : new Date ( ) . toLocaleString ( )
102
+ date_created : new Date ( ) . toLocaleString ( ) ,
103
+ date_modified : new Date ( ) . toLocaleString ( )
103
104
} ;
104
105
const contentsService = CodeSnippetContentsService . getInstance ( ) ;
105
106
const currSnippets = codeSnippetWidget . codeSnippetWidgetModel . snippets ;
You can’t perform that action at this time.
0 commit comments