Process {{EPOCH}} template placeholder
This commit is contained in:
parent
d19f71926d
commit
e6d25f4fa0
1
.idea/.name
Normal file
1
.idea/.name
Normal file
|
|
@ -0,0 +1 @@
|
|||
filename_template
|
||||
8
.idea/modules.xml
Normal file
8
.idea/modules.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/filename_template-merge.iml" filepath="$PROJECT_DIR$/.idea/filename_template-merge.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
|
|
@ -24,9 +24,14 @@ class CreateFileWithFilenameTemplateAction(
|
|||
IdeBundle.message("prompt.enter.new.file.name"),
|
||||
IdeBundle.message("title.new.file"),
|
||||
null,
|
||||
template,
|
||||
processTemplate(template),
|
||||
validator
|
||||
)
|
||||
return validator.createdElements
|
||||
}
|
||||
|
||||
private fun processTemplate(template: String): String {
|
||||
val epoch = LocalDateTime.now(ZoneOffset.UTC).toEpochSecond(ZoneOffset.UTC)
|
||||
return template.replace("{{EPOCH}}", epoch.toString())
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user