1
0
Fork 0

Add timestamp to title.

This commit is contained in:
Benjamin F 2022-08-03 11:30:45 -07:00
parent 3e7dddca82
commit 5d9dc1fb88
3 changed files with 10 additions and 2 deletions

View file

@ -4,7 +4,7 @@ title: "@freesewing/plugin-title"
The **@freesewing/plugin-title** plugin provides [the The **@freesewing/plugin-title** plugin provides [the
title macro](/reference/api/macros/title/) which facilitates adding part titles title macro](/reference/api/macros/title/) which facilitates adding part titles
to your desings. to your designs.
<Example part="plugin_title">An example of the title macro</Example> <Example part="plugin_title">An example of the title macro</Example>

View file

@ -2,7 +2,7 @@
title: Titles title: Titles
--- ---
Each pattern piece has a title that tells you the number and name of the piece, as well as the pattern name: Each pattern piece has a title that tells you the number and name of the piece, as well as the pattern name and a timestamp of when the pattern was rendered:
<Legend part="title"> <Legend part="title">

View file

@ -92,6 +92,14 @@ export default {
.attr('data-text-class', 'fill-current font-bold') .attr('data-text-class', 'fill-current font-bold')
.attr('data-text-transform', transform(so.at.shift(-90 - so.rotation, shift * so.scale))) .attr('data-text-transform', transform(so.at.shift(-90 - so.rotation, shift * so.scale)))
} }
shift += 8
const dateformat = require('dateformat')
const now = new Date()
this.points[`_${prefix}_exportDate`] = so.at
.shift(-90 - so.rotation, shift * so.scale)
.attr('data-text', dateformat(now, 'yyyymmdd"T"HHMMo'))
.attr('data-text-class', 'fill-note')
.attr('data-text-transform', transform(so.at.shift(-90 - so.rotation, shift * so.scale)))
}, },
}, },
} }