Replies: 1 comment 5 replies
-
Hmm this doesn't make much sense. That said, you could try this out: #1097 |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have one usecase, where i (while applying one of templates) input the needed date and then use it... tp.date.now() does not suit me and i decided to do it manually
insertDate.js
async function insertDate(tp) {
const mmnt = await tp.system.prompt("Enter the date (YYYY-MM-DD):");
tp.store.set("manualDate",mmnt);
}
module.exports = insertDate;
manualDate.js
async function manualDate(tp,format) {
const storedDate = tp.store.get("manualDate");
if (storedDate) {
const mmnt = moment(storedDate);
return mmnt.format(format);
}
}
module.exports = manualDate;
this template gives error
<% tp.user.insertDate(tp) %>
<% tp.user.manualDate("DD MMM YYYY, dddd") %>
i understand that insertDate has no time for saving the manually entered date in order to give it further to manualDate script. How can i solve this?
Beta Was this translation helpful? Give feedback.
All reactions