From wiki.ginstr.com
Jump to: navigation, search
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
<div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div>
 
<div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div>
<span STYLE="font-size: xx-large"><code>gn:act_setSelectedItem</code></span>
+
<span STYLE="font-size: xx-large"><code>gn:act_convertTimestampToFormat</code></span>
 
[[Category:Action_Library]]
 
[[Category:Action_Library]]
  
;Description: Action used to select dropdown item <code>[[GnDropDown]]</code>
+
;Description: Action used to convert timestamp (numerical value) from certain widget to human readable format. Action by default formats time in relation to local timezone of user.
  
 
;Action returns: void
 
;Action returns: void
 
==Action signatures==
 
==Action signatures==
  
=== ===
+
===Convert timestamp from certain widget===
  
;<code> </code>
+
:;<code>[gn:act_convertTimestampToFormat]|[source,target,format]</code>
  
{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
+
with timezone
 +
 
 +
:;<code>[gn:act_convertTimestampToFormat]|[source,target,format,manualTimeZone]</code>
 +
 
 +
:{| class="wikitable sortable" style="font-size: 85%; text-align: left;"
 
|-
 
|-
 
! scope="col" | Parameter
 
! scope="col" | Parameter
 
! scope="col" | Description
 
! scope="col" | Description
 
|-
 
|-
| [[source|parameterSource]]
+
| <code>[[source]]</code>
| [[source]] from where the while action is using value as expression parameter
+
| [[source]] from where value for conversion will be retrieved
 
* Valid [[source|sources]]:
 
* Valid [[source|sources]]:
** any [[source]]
+
**<code>[[Datatypes#text|text]]</code>
 +
**<code>[[Datatypes#date|date]]</code>
 +
**<code>[[Datatypes#dateTime|dateTime]]</code>
 +
**<code>[[Datatypes#time|time]]</code>
 +
**<code>[[Datatypes#number|number]]</code>
 
|-
 
|-
| [[source|comparedSource]]
+
| <code>[[target]]</code>
| [[source]] from where the while action is using value as expression comparsion parameter
+
| [[target]] from where the while action is using value as expression comparsion parameter
* Valid [[source|sources]]:
+
* Valid [[target|targets]]:
** any [[source]]
+
** <code>[[Datatypes#text|text]]</code>
 +
|-
 +
| <code>format</code>
 +
| format in which [[source]] value will be converted
 +
* Valid formats:
 +
**[http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html formats]
 +
|-
 +
| <code>manualTimeZone</code>
 +
| timeZone in which timestamp will be shown. By default it's local timezone. If <code>DATE</code> datatype is used then default timezone is <code>GMT</code>. Valid timezones:
 +
[https://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html timezone construct]
 +
* Valid [[target|targets]]:
 +
** <code>[[Datatypes#text|text]]</code>
 
|-
 
|-
 
|}
 
|}
  
 
====Example====
 
====Example====
<code></code> - <br>
+
:<code>@+id/timeInDATA</code> - [[source]]<br>  
<code></code> - <br><br>
+
:<code>@+id/clockTimeIn</code> - [[target]]<br>
<code></code>
+
:<code>@string/screen3_timeFormat</code> - format e.g. <code>dd.MM.yyyy H:mm:ss</code><br>
 +
:; ⤷ <code>[gn:act_convertTimestampToFormat]|[@+id/timeInDATA,@+id/clockTimeIn,@string/screen3_timeFormat]</code>
 
<hr>
 
<hr>
 
 
 
 
<div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div>
 
<span STYLE="font-size: xx-large"><code>gn:act_convertTimestampToFormat</code></span>
 
[[Category:Action_Library]]
 
 
<code>[[gn:act_convertTimestampToFormat]]</code> is used to convert timestamp (numerical value) from certain widget to human readable format.
 
 
;Can be used on widgets: any widget
 
 
;Event trigger for action: no event, must be used in action set or conditional action.
 
 
;Can be used as: a [[:Category:Actions#Action_types|no event action]]
 
 
;Additional required attributes on bound widget: none
 
 
;Additional required attributes on other widgets: none
 
==Action signature==
 
;<code>[gn:act_convertTimestampToFormat]|[@+id/sourceWidget,@+id/targetWidget,format]</code>
 
==Value field content==
 
;<code>sourceWidget</code>: defines widget from which data is retrieved for conversion.
 
:Currently implemented for:
 
::*<code>[[GnEditText]]</code> – value in <code>[[GnEditText]]</code> must be timestamp
 
;<code>targetWidget</code>: widget into which converted timestamp will be stored.
 
:Currently implemented for:
 
::*<code>[[GnEditText]]</code>
 
;<code>format</code>: acceptable formats can be found [http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html here]
 
::i.e. <code>"dd.MM.yyyy hh:mm"</code>
 

Latest revision as of 13:27, 4 November 2020

gn:act_convertTimestampToFormat

Description
Action used to convert timestamp (numerical value) from certain widget to human readable format. Action by default formats time in relation to local timezone of user.
Action returns
void

Action signatures

Convert timestamp from certain widget

[gn:act_convertTimestampToFormat]|[source,target,format]

with timezone

[gn:act_convertTimestampToFormat]|[source,target,format,manualTimeZone]
Parameter Description
source source from where value for conversion will be retrieved
target target from where the while action is using value as expression comparsion parameter
format format in which source value will be converted
manualTimeZone timeZone in which timestamp will be shown. By default it's local timezone. If DATE datatype is used then default timezone is GMT. Valid timezones:

timezone construct

Example

@+id/timeInDATA - source
@+id/clockTimeIn - target
@string/screen3_timeFormat - format e.g. dd.MM.yyyy H:mm:ss
[gn:act_convertTimestampToFormat]|[@+id/timeInDATA,@+id/clockTimeIn,@string/screen3_timeFormat]