Repository navigation
User JSON TimeTextIndicator
Back to list | Indicator page | Русский
This page describes the JSON template of the timeText indicator for manual editing of .vttp. The indicator shows the current time, the time zone and the "passed" and "left" intervals.
{
"name": "com.velitask.plagin.official.timeText",
"data": {
"maket": { "preset": "auto" },
"properties": {
"referenceSource": {},
"font": {"name":"Dialog","style":0,"size":48,"color":{"r":255,"g":255,"b":255,"a":255}},
"textAlign": {"value":4},
"timeZone": {"value":""},
"timeFormat": {"value":"dd.MM.yyyy HH:mm:ss"},
"durationFormat": {"value":"HH:mm:ss"},
"textTemplate": {"template":"Time {curr} / passed {passed}","vars":{"curr":"%s","tzid":"%s","passed":"%s","left":"%s"}}
}
}
}An empty timeZone value means the time zone of the computer.
The reference source ("Reference source"): "passed" and "left" are calculated from its start and end. An empty object means the source is chosen automatically, the one with the longest duration. If there is no source, the period is taken from the project.
{
"referenceSource": {}
}| Field | Values | What it does |
|---|---|---|
sourceId |
optional; not specified in a template | Pins a specific source of the project. The identifier is known only in a real project, so the field is usually omitted in a manual template. |
The font ("Font"): name, style, size and color of the text.
{
"font": {"name":"Dialog","style":0,"size":48,"color":{"r":255,"g":255,"b":255,"a":255}}
}| Field | Values | What it does |
|---|---|---|
name |
font name, for example Dialog
|
Font family. |
style |
0, 1, 2
|
Style: 0 plain, 1 bold, 2 italic. |
size |
integer 1..999
|
Font size (48 by default). |
color |
color object | Text color. |
Fields of the color:
| Field | Values | What it does |
|---|---|---|
r |
0..255 |
Red channel. |
g |
0..255 |
Green channel. |
b |
0..255 |
Blue channel. |
a |
0..255 |
Opacity: 0 fully transparent, 255 opaque. |
Text alignment inside the layer ("Text Alignment").
{
"textAlign": {"value":4}
}| Field | Values | What it does |
|---|---|---|
value |
0..8 |
Position of the text (4 by default). |
| Value | Position |
|---|---|
0 |
Top left |
1 |
Top center |
2 |
Top right |
3 |
Middle left |
4 |
Center |
5 |
Middle right |
6 |
Bottom left |
7 |
Bottom center |
8 |
Bottom right |
The time zone ("Time zone") for the current time {curr} and the name {tzid}.
{
"timeZone": {"value":""}
}| Field | Values | What it does |
|---|---|---|
value |
zone identifier, for example Europe/Moscow, UTC, Asia/Tokyo
|
Selects the time zone. An empty value or an unknown identifier means the time zone of the computer. |
The date and time format ("Time format") for {curr}.
{
"timeFormat": {"value":"dd.MM.yyyy HH:mm:ss"}
}| Field | Values | What it does |
|---|---|---|
value |
format string | Describes the look of the date and time. The default is dd.MM.yyyy HH:mm:ss. |
| Designation | What it outputs |
|---|---|
dd |
Day of the month |
MM |
Month as a number |
yyyy |
Year |
HH |
Hours 0–23 |
mm |
Minutes |
ss |
Seconds |
If the format has an error, yyyy-MM-dd HH:mm:ss is used instead.
The format of the intervals ("Duration format") for {passed} and {left}.
{
"durationFormat": {"value":"HH:mm:ss"}
}| Field | Values | What it does |
|---|---|---|
value |
format string | Describes the look of an interval. The default is HH:mm:ss. |
| Designation | What it outputs |
|---|---|
d, dd
|
Whole days |
H, HH
|
Hours within a day, 0–23 |
m, mm
|
Minutes |
s, ss
|
Seconds |
'text' |
A literal in single quotes |
A doubled designation adds a leading zero. Negative intervals are output as zero. For a time longer than a day add d, for example "d 'd' HH:mm:ss".
The resulting string. The template has the current time, the time zone name, and the passed and left time available.
{
"textTemplate": {"template":"Time {curr} / passed {passed}","vars":{"curr":"%s","tzid":"%s","passed":"%s","left":"%s"}}
}| Field | Values | What it does |
|---|---|---|
template |
string | The resulting text with variables in curly braces. The default is Time {curr} / passed {passed}. |
vars |
object | Formats of the variables. All four variables use the %s format. |
Ready-made text options: {curr} (the "Compact" skin) and {curr} ({tzid}) (the "With zone" skin).
| Variable | Default format | What it shows |
|---|---|---|
{curr} |
%s |
The current time of the frame in the selected time zone and time format. |
{tzid} |
%s |
The full name of the time zone. |
{passed} |
%s |
How much has passed since the start of the period of the reference source (or the project) in the duration format. |
{left} |
%s |
How much is left until the end of the period in the duration format. |
All four variables are strings, so only a string format works: %s or, for example, %10s to align by width. Numeric formats (%d, %.1f) do not work: the variable will be replaced with an empty string.