Add timestamp to title.
This commit is contained in:
parent
3e7dddca82
commit
5d9dc1fb88
3 changed files with 10 additions and 2 deletions
|
@ -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>
|
||||||
|
|
||||||
|
|
|
@ -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">
|
||||||
|
|
||||||
|
|
|
@ -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)))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue