Does anybody know of a plugin that allows you to add current date in dd/mm/yy format in a textbox? I’ve just tried Powerful Tools, but only adds a random date. Thank you!
Page 1 / 1
@Gabriel_Leni With the Scripter plugin, you can use this code snippet to place the date into any selected text box.
for (const node of figma.currentPage.selection) {
if (node.type === 'TEXT') {
const date = new Date();
// Edit this array to display months in a different format
const monthArray = ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
// This shortens the year to two digits
const shortYear = date.getFullYear().toString().substr(-2);
// Edit this to change the date format
// Currently the format is XX/XX/XX
node.characters = monthArray[date.getMonth()] + "/" + date.getDate() + "/" + shortYear;
}
}
Insteresting! Will this give a try…! Thanks a lot @ntfromchicago !
Brilliant! Will give this a look! 🙂
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.