@ygracs/xepg-lib-js 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,9 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019-2022 Yuri Grachev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,39 @@
1
+ |***rev.*:**|0.0.5|
2
+ |:---|---:|
3
+ |***date***:|2022-12-06|
4
+
5
+ ## Introduction
6
+
7
+ This module provide a base functionality for handling an EPG-sources based on XEPG-format.
8
+
9
+ > For more information about a XEPG-format see `xepgdoc-spec.md`in the project `doc` directory.
10
+
11
+ ## Use cases
12
+
13
+ This module was make for use as a library in a development of a Web-apps based on [Electron](https://en.wikipedia.org/wiki/Electron_(software_framework)) as main target.
14
+
15
+ ## Description
16
+
17
+ This module contains the following components:
18
+
19
+ ### 1. a set of XEPG-document constants and components
20
+
21
+ - constants:
22
+
23
+ - classes:
24
+
25
+ + `TXEpgSchedulesList`;
26
+ + `TXepgDTSProvider`;
27
+ + `TXEpgProviderContainer`;
28
+ + `TXEpgHeaderContainer`;
29
+ + `TXEpgContentContainer`.
30
+
31
+ For more read the `xepgdoc-lib.md` in the project `doc` directory.
32
+
33
+ ### 2. a set of other constants and components
34
+
35
+ - constants:
36
+
37
+ - classes:
38
+
39
+ + `TXmlContentParseOptions`;
@@ -0,0 +1,31 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <epgdoc xmlns:tvp="urn:e-doc:epg-doc:xepg">
3
+ <tvp:info>
4
+ <tvp:provider>
5
+ <name>EPG_Provider_Name</name>
6
+ <version>0.0.1</version>
7
+ <tvp:schema>0.2</tvp:schema>
8
+ <tvp:doctype>xepg</tvp:doctype>
9
+ </tvp:provider>
10
+ <tvp:chnid>Channel_ID</tvp:chnid>
11
+ <tvp:chngid>Group_ID</tvp:chngid>
12
+ <tvp:chname>Channel_Name</tvp:chname>
13
+ <tvp:srcurl>http://example.com/channel-page.html</tvp:srcurl>
14
+ <tvp:time>2022.03.11 10:32:31</tvp:time>
15
+ <tvp:expire>2022.03.14 23:00:00</tvp:expire>
16
+ <tvp:timezone>+0100</tvp:timezone>
17
+ <tvp:dtstype>
18
+ <value>0</value>
19
+ <name>default</name>
20
+ </tvp:dtstype>
21
+ </tvp:info>
22
+ <tvp:list>
23
+ <tvp:item>
24
+ <tvp:time>2022.03.11 03:00:00</tvp:time>
25
+ <tvp:title>Schedule_title</tvp:title>
26
+ <tvp:pcmark>0</tvp:pcmark>
27
+ <tvp:cat>Films, Comedy</tvp:cat>
28
+ <tvp:desc>Some_words_about_schedule</tvp:desc>
29
+ </tvp:item>
30
+ </tvp:list>
31
+ </epgdoc>
@@ -0,0 +1,286 @@
1
+ |***rev.*:**|0.0.13|
2
+ |:---|---:|
3
+ |***date***:|2022-12-06|
4
+
5
+ ## Introduction
6
+
7
+ This paper describes a constants and an object classes provided by `xepgdoc-lib.js` module.
8
+
9
+ ## Module constants
10
+
11
+ ## Module classes
12
+
13
+ ### **TXEpgSchedulesList**
14
+
15
+ This class provides a functionality for handle an EPG-schedules list.
16
+
17
+ #### class constructor
18
+
19
+ The class constructor creates a new instance of the class. It receives arguments listed below:
20
+
21
+ |name|type|default value|description|
22
+ |:---|---|---:|:---|
23
+ |`object`|---|---|a host object|
24
+ |`options`|`object`|---|an options settings|
25
+
26
+ #### class properties
27
+
28
+ The table below describes a properties of a `TXEpgSchedulesList` class:
29
+
30
+ |property name|property type|read only|description|
31
+ |:---|---|---|:---|
32
+ |`schedQty`|`number`|yes|returns a quantity of the elements|
33
+ |`dtstype`|`index`|yes|returns a "dtstype"-value|
34
+ |`curDocTZ`|`number`|yes|returns a current TimeZone|
35
+
36
+ #### class methods
37
+
38
+ ##### **hasNoSchedules()**
39
+
40
+ This method returns `true` if a document contains no schedules.
41
+
42
+ ##### **hasSchedules()**
43
+
44
+ This method returns `true` if a document contains at least one schedule.
45
+
46
+ ##### **chkScheduleIndex(value)**
47
+
48
+ This method checks if a given `value` represents a valid schedule index and if so returns `true`.
49
+
50
+ ##### **getScheduleInfo(index)**
51
+
52
+ This method returns an object that contains a schedule information.
53
+
54
+ ##### **getAllSchedulesInfo()**
55
+
56
+ This method returns an array that contains an information for all available schedules.
57
+
58
+ #### class methods (*special*)
59
+
60
+ ##### **asJSON()**
61
+
62
+ ### **TXEpgProviderContainer**
63
+
64
+ This class implements a structure that holds an information about a program provider within which the content of the document was written.
65
+
66
+ #### class constructor
67
+
68
+ The class constructor creates a new instance of the class. It receives arguments listed below:
69
+
70
+ |name|type|default value|description|
71
+ |:---|---|---:|:---|
72
+ |`object`|---|---|a host object|
73
+ |`options`|---|---|an option settings|
74
+
75
+ The `options` structure is listed below:
76
+
77
+ |option name|value type|default value|description|
78
+ |:---|---|---:|:---|
79
+ |`parseOptions`|`object`|`EMPTY_OBJECT`|contains a XML-parse options (see description for `XML_DEF_PARSE_OPTIONS`)|
80
+
81
+ #### class properties
82
+
83
+ The table below describes a properties of a `TXEpgProviderContainer` class:
84
+
85
+ |property name|property type|read only|description|
86
+ |:---|---|---|:---|
87
+ |`name`|`string`|no|defines a provider name|
88
+ |`version`|`string`|no|defines a provider version string|
89
+ |`schema`|`string`|no|defines a document schema version|
90
+ |`doctype`|`string`|no|defines a document type|
91
+
92
+ #### class methods
93
+
94
+ ##### **setName(value)**
95
+
96
+ This method sets a name of a provider to a given `value`.
97
+
98
+ ##### **getInfo()**
99
+
100
+ This method returns an `object` that contains information about content provider.
101
+
102
+ ##### **setInfo(obj)**
103
+
104
+ This method loads information about content provider.
105
+
106
+ #### class methods (*special*)
107
+
108
+ ##### **init()**
109
+
110
+ ### **TXEpgDTSProvider**
111
+
112
+ #### class constructor
113
+
114
+ The class constructor creates a new instance of the class. It receives arguments listed below:
115
+
116
+ |name|type|default value|description|
117
+ |:---|---|---:|:---|
118
+ |`object`|---|---|a host object|
119
+ |`options`|---|---|an option settings|
120
+
121
+ The `options` structure is listed below:
122
+
123
+ |option name|value type|default value|description|
124
+ |:---|---|---:|:---|
125
+ |`parseOptions`|`object`|`EMPTY_OBJECT`|contains a XML-parse options (see description for `XML_DEF_PARSE_OPTIONS`)|
126
+
127
+ #### class properties
128
+
129
+ The table below describes a properties of a `TXEpgDTSProvider` class:
130
+
131
+ |property name|property type|read only|description|
132
+ |:---|---|---|:---|
133
+ |`dtstype`|`index`|no|defines a "dtstype"-value|
134
+ |`curDocTZ`|`number`|no|defines a current TimeZone|
135
+
136
+ ### **TXEpgHeaderContainer**
137
+
138
+ #### class constructor
139
+
140
+ The class constructor creates a new instance of the class. It receives arguments listed below:
141
+
142
+ |name|type|default value|description|
143
+ |:---|---|---:|:---|
144
+ |`object`|---|---|a host object|
145
+ |`options`|---|---|an option settings|
146
+
147
+ The `options` structure is listed below:
148
+
149
+ |option name|value type|default value|description|
150
+ |:---|---|---:|:---|
151
+ |`parseOptions`|`object`|`EMPTY_OBJECT`|contains a XML-parse options (see description for `XML_DEF_PARSE_OPTIONS`)|
152
+
153
+ #### class properties
154
+
155
+ The table below describes a properties of a `TXEpgHeaderContainer` class:
156
+
157
+ |property name|property type|read only|description|
158
+ |:---|---|---:|:---|
159
+ |`dtstype`|`index`|no|defines a "dtstype"-value|
160
+ |`curDocTZ`|`number`|no|defines a current TimeZone|
161
+ |`Provider`|`TXEpgProviderContainer`|yes|returns a `TXEpgProviderContainer`|
162
+ |`dts`|`TXepgDTSProvider`|yes|returns a `TXEpgDTSProvider`|
163
+
164
+ #### class methods
165
+
166
+ ##### **getDocumentDT()**
167
+
168
+ This method returns a time value of a document creation.
169
+
170
+ ##### **setDocumentDT()**
171
+
172
+ This method sets a time value of a document creation.
173
+
174
+ ##### **getDocumentEDT()**
175
+
176
+ This method returns a time value from which a document is expired.
177
+
178
+ ##### **setDocumentEDT(value)**
179
+
180
+ This method sets a time value at which a document will be expired.
181
+
182
+ ##### **getChannelInfo()**
183
+
184
+ This method returns an object which contains a channel information.
185
+
186
+ An object contains the following fields:
187
+
188
+ |field name|field type|description|
189
+ |:---|---|:---|
190
+ |`chnid`|`ID_STRING`|a channel ID|
191
+ |`chname`|`string`|a name of the channel|
192
+ |`chngid`|`ID_STRING`|a channel group|
193
+ |`srcurl`|`string`|a link to source|
194
+
195
+ ##### **setChannelInfo(obj)**
196
+
197
+ This method fills a channel information with a given data.
198
+
199
+ The `obj` parameter can be a string or an array or an object.
200
+
201
+ If a string is given it mean to contains the `chnid` value.
202
+
203
+ If an array is given it contains the following fields:
204
+
205
+ `[ <chnid>, <chname>, <chngid>, <srcurl> ]`
206
+
207
+ If an object is given it contains the following fields:
208
+
209
+ |field name|field type|description|
210
+ |:---|---|:---|
211
+ |`chnid`|`ID_STRING`|a channel ID|
212
+ |`chname`|`string`|a name of the channel|
213
+ |`chngid`|`ID_STRING`|a channel group|
214
+ |`srcurl`|`string`|a link to source|
215
+
216
+ ##### **getProviderInfo()**
217
+
218
+ This method returns an object which contains an information about document provider.
219
+
220
+ ##### **setProviderInfo(obj)**
221
+
222
+ ### **TXEpgContentProvider**
223
+
224
+ #### class constructor
225
+
226
+ The class constructor creates a new instance of the class. It receives arguments listed below:
227
+
228
+ |name|type|default value|description|
229
+ |:---|---|---:|:---|
230
+ |`options`|`object`|---|an options settings|
231
+
232
+ The `options` structure is listed below:
233
+
234
+ |option name|value type|default value|description|
235
+ |:---|---|---:|:---|
236
+ |`parseOptions`|`object`|`EMPTY_OBJECT`|contains a XML-parse options (see description for `XML_DEF_PARSE_OPTIONS`)|
237
+ |`autoBindRoot`|`boolean`|`false`|<*reserved*>|
238
+
239
+ #### class properties
240
+
241
+ The table below describes a properties of a `TXEpgContentProvider` class:
242
+
243
+ |property name|property type|read only|description|
244
+ |:---|---|---|:---|
245
+ |`Header`|`TXEpgHeaderContainer`|yes|returns a `TXEpgHeaderContainer`|
246
+ |`Provider`|`TXEpgProviderContainer`|yes|returns a `TXEpgProviderContainer`|
247
+ |`SchedulesList`|`TXEpgSchedulesList`|yes|returns a `TXEpgSchedulesList`|
248
+ |`dts`|`TXEpgDTSProvider`|yes|returns a `TXEpgDTSProvider`|
249
+
250
+ #### class methods
251
+
252
+ ##### **loadFromString(xmlString, options)**
253
+
254
+ This method loads a document content from string containing text in XML format.
255
+
256
+ ##### **loadFromFile(src)**
257
+
258
+ This method loads a document content from a file. A `src` provided a string that is a path to the file.
259
+
260
+ ##### **loadFromFileSync(src)**
261
+
262
+ This method loads a document content from a file. A `src` provided a string that is a path to the file.
263
+
264
+ ##### **saveToXMLString()**
265
+
266
+ This method saves a document content to a string.
267
+
268
+ ##### **saveToFile(src)**
269
+
270
+ This method saves a document content to a file. A `src` provided a string that is a path to the file.
271
+
272
+ ##### **saveToFileSync(src)**
273
+
274
+ This method saves a document content to a file. A `src` provided a string that is a path to the file.
275
+
276
+ ##### **asXML(options)**
277
+
278
+ This method saves a document content to a string.
279
+
280
+ > Note: will deprecate.
281
+
282
+ #### class methods (*special*)
283
+
284
+ ##### **init()**
285
+
286
+ ##### **asJSON()**
@@ -0,0 +1,124 @@
1
+ |***rev.*:**|0.0.5|
2
+ |:---|---:|
3
+ |***date***:|2022-12-01|
4
+
5
+ ## Introduction
6
+
7
+ This paper describes the purpose and use of XEPG-document and also the structure of it.
8
+
9
+ > Note: the following content which is described below applied to document that structure follow the rule of a document schema with "`v0.2`".
10
+
11
+ ## Content
12
+
13
+ ## XEPG-document structure
14
+
15
+ ### XEPG-document format
16
+
17
+ The XEPG-document format is base on XML and stored in file with `xepg` or `xml` extension.
18
+
19
+ > Note: You can see what it is look like in the file example (*see `xepgdoc-example.xepg`*) which include in the docs module directory.
20
+
21
+ ### Root element
22
+
23
+ The root element of the document starts by XML-tag named `epgdoc`. It contains two parts: the header and the body elements.
24
+
25
+ The root element sets XML namespace `tvp` for entire document.
26
+
27
+ ### Header element
28
+
29
+ The header element starts by a tag named `tvp:info`. It consists of the following parts:
30
+
31
+ - document provider information;
32
+ - channel information;
33
+ - document time attributes.
34
+
35
+ #### Provider info element
36
+
37
+ The provider info element starts by a tag named `tvp:provider`. Its elements contains information about software agent which generated document and also defines a document type and document schema.
38
+
39
+ ##### **provider name**
40
+
41
+ The provider name attribute represented by a tag named `name`.
42
+
43
+ ##### **provider version**
44
+
45
+ The provider version attribute represented by a tag named `version`.
46
+
47
+ ##### **document schema attribute**
48
+
49
+ The document schema attribute represented by a tag named `tvp:schema`.
50
+
51
+ ##### **document type attribute**
52
+
53
+ The document type attribute represented by a tag named `tvp:doctype`.
54
+
55
+ #### Channel information fields
56
+
57
+ ##### **channel ID**
58
+
59
+ The channel ID field represented by a tag named `tvp:chnid`.
60
+
61
+ ##### **channel group ID**
62
+
63
+ The channel group ID field represented by a tag named `tvp:chngid`.
64
+
65
+ ##### **channel name**
66
+
67
+ The channel name field represented by a tag named `tvp:chname`.
68
+
69
+ ##### **channel source URL**
70
+
71
+ The channel source URL field represented by a tag named `tvp:srcurl`.
72
+
73
+ #### Document time attributes
74
+
75
+ ##### **document creation time**
76
+
77
+ The document creation time attribute represented by a tag named `tvp:time`.
78
+
79
+ ##### **document expiration time**
80
+
81
+ The document expiration time attribute represented by a tag named `tvp:expire`.
82
+
83
+ ##### **timezone attribute**
84
+
85
+ The document timezone attribute represented by a tag named `tvp:timezone`.
86
+
87
+ ##### **DateTime system type element**
88
+
89
+ The DateTime system type (*dtstype*) element starts by tag named `tvp:dtstype` and consists of the two elements:
90
+
91
+ - `value` - the first element defines an index of dtstype which is used for date and time representation along with a document;
92
+ - `name` - the second element is a string which represent a name of dtstype given by `value` element.
93
+
94
+ ### Body element
95
+
96
+ The body element starts by a tag named `tvp:list` and holds all the schedule elements associated with the channel.
97
+
98
+ ### Schedule element
99
+
100
+ The schedule element starts by a tag named `tvp:item`.
101
+
102
+ ##### **schedule time attribute**
103
+
104
+ The schedule time attribute represented by a tag named `tvp:time`. Its value is a string that represents date and time of the schedule. The format of a such string is based on the rules defined by the used dtstype value.
105
+
106
+ ##### **schedule title**
107
+
108
+ The schedule title attribute represented by a tag named `tvp:title`.
109
+
110
+ ##### **schedule subtitle**
111
+
112
+ ##### **schedule categories**
113
+
114
+ The schedule categories attribute represented by a tag named `tvp:cat`.
115
+
116
+ ##### **schedule description**
117
+
118
+ The schedule description attribute represented by a tag named `tvp:desc`.
119
+
120
+ ##### **schedule rating**
121
+
122
+ The schedule rating attribute represented by a tag named `tvp:pcmark`.
123
+
124
+ ##### **schedule star-rating**
package/index.js ADDED
@@ -0,0 +1,23 @@
1
+ // [v0.0.007-20220908]
2
+
3
+ // === module init block ===
4
+
5
+ const xepg_doc = require('./lib/xepgdoc-lib.js');
6
+
7
+ const xObj = require('@ygracs/xobj-lib-js');
8
+
9
+ // === module extra block (helper functions) ===
10
+
11
+ // === module main block ===
12
+
13
+ // === module exports block ===
14
+
15
+ /**/// v1 branch
16
+ exports.TXEpgContentProvider = xepg_doc.TXEpgContentProvider;
17
+ exports.TXEpgSchedulesList = xepg_doc.TXEpgSchedulesList;
18
+ exports.TXepgDTSProvider = xepg_doc.TXepgDTSProvider;
19
+ exports.TXEpgProviderContainer = xepg_doc.TXEpgProviderContainer;
20
+ exports.TXEpgHeaderContainer = xepg_doc.TXEpgHeaderContainer;
21
+
22
+ // re-export stuff from `@ygracs/xobj-lib-js` module
23
+ exports.TXmlContentParseOptions = xObj.TXmlContentParseOptions;
@@ -0,0 +1,141 @@
1
+ // [v0.1.040-20221126]
2
+
3
+ // === module init block ===
4
+
5
+ const {
6
+ valueToIndex, readAsString, readAsNumberEx,
7
+ } = require('@ygracs/bsfoc-lib-js');
8
+
9
+ const {
10
+ convDTValueToISO8601,
11
+ convDTValueToXMLTV, convXMLTVToDTValue,
12
+ convDTValueToDateString,
13
+ } = require('@ygracs/dtf-lib-js');
14
+
15
+ const def_dts_param = [
16
+ 'default', 'iso8601', 'xmltv', 'timestamp', 'utc',
17
+ ];
18
+
19
+ // === module extra block (helper functions) ===
20
+
21
+ // === module main block (function definitions) ===
22
+
23
+ function chkDTSysID(value){
24
+ const _value = valueToIndex(value);
25
+ return _value !== -1 && def_dts_param[_value] ? true : false;
26
+ };
27
+
28
+ function getDTSysName(value){
29
+ let result = 'undefined';
30
+ if (chkDTSysID(value)) {
31
+ result = def_dts_param[Number(value)];
32
+ };
33
+ return result;
34
+ };
35
+
36
+ function convStringToDTValue(value, dts_id, tz){
37
+ let result = 0;
38
+ let dtstype = valueToIndex(dts_id);
39
+ let dt_str = typeof value === 'string' ? value : '';
40
+ if (chkDTSysID(dtstype)) {
41
+ switch (getDTSysName(dtstype)) {
42
+ case 'default':
43
+ // TODO: check TZ
44
+ //console.log('convStringToDTValue => dtstype:[default]');
45
+ result = (new Date(dt_str)).getTime();
46
+ //console.log('convStringToDTValue => value:['+value+']');
47
+ //console.log('convStringToDTValue => result:['+result+']');
48
+ break;
49
+ case 'iso8601':
50
+ // TODO: check TZ
51
+ //console.log('convStringToDTValue => dtstype:[iso8601]');
52
+ result = (new Date(dt_str)).getTime();
53
+ //console.log('convStringToDTValue => value:['+value+']');
54
+ //console.log('convStringToDTValue => result:['+result+']');
55
+ break;
56
+ case 'xmltv':
57
+ // TODO: check TZ
58
+ //console.log('convStringToDTValue => dtstype:[xmltv]');
59
+ result = (new Date(convXMLTVToDTValue(dt_str))).getTime();
60
+ //console.log('convStringToDTValue => value:['+value+']');
61
+ //console.log('convStringToDTValue => result:['+result+']');
62
+ break;
63
+ case 'timestamp':
64
+ // TODO: check TZ
65
+ //console.log('convStringToDTValue => dtstype:[timestamp]');
66
+ result = Number(dt_str);
67
+ //console.log('convStringToDTValue => value:['+value+']');
68
+ //console.log('convStringToDTValue => result:['+result+']');
69
+ break;
70
+ case 'utc':
71
+ // TODO: check TZ
72
+ //console.log('convStringToDTValue => dtstype:[utc]');
73
+ result = (new Date(Date.UTC(dt_str))).getTime();
74
+ //console.log('convStringToDTValue => value:['+value+']');
75
+ //console.log('convStringToDTValue => result:['+result+']');
76
+ break;
77
+ default:
78
+ break;
79
+ };
80
+ if (Number.isNaN(result)) result = 0;
81
+ };
82
+ return result;
83
+ };
84
+
85
+ function convDTValueToString(value, dts_id, tz){
86
+ let result = '';
87
+ let dtstype = valueToIndex(dts_id);
88
+ let dt_val = (new Date(readAsNumberEx(value, 0))).getTime();
89
+ if (Number.isNaN(dt_val)) dt_val = new Date(0);
90
+ if (!chkDTSysID(dtstype)) dtstype = 0;
91
+ switch (getDTSysName(dtstype)) {
92
+ case 'default':
93
+ // TODO: check TZ
94
+ //console.log('convDTValueToString => dtstype:[default]');
95
+ result = convDTValueToDateString(dt_val, {
96
+ src_in_utc: false,
97
+ });
98
+ //console.log('convDTValueToString => value:['+value+']');
99
+ //console.log('convDTValueToString => result:['+result+']');
100
+ break;
101
+ case 'iso8601':
102
+ // TODO: check TZ
103
+ //console.log('convDTValueToString => dtstype:[iso8601]');
104
+ result = convDTValueToISO8601(dt_val, {
105
+ use_bs_format: false,
106
+ src_in_utc: false,
107
+ });
108
+ //console.log('convDTValueToString => value:['+value+']');
109
+ //console.log('convDTValueToString => result:['+result+']');
110
+ break;
111
+ case 'xmltv':
112
+ // TODO: check TZ
113
+ //console.log('convDTValueToString => dtstype:[xmltv]');
114
+ result = convDTValueToXMLTV(dt_val, {
115
+ src_in_utc: false,
116
+ });
117
+ //console.log('convDTValueToString => value:['+value+']');
118
+ //console.log('convDTValueToString => result:['+result+']');
119
+ break;
120
+ case 'timestamp':
121
+ // TODO: check TZ
122
+ //console.log('convDTValueToString => dtstype:[timestamp]');
123
+ result = dt_val.toString();
124
+ //console.log('convDTValueToString => value:['+value+']');
125
+ //console.log('convDTValueToString => result:['+result+']');
126
+ break;
127
+ default:
128
+ break;
129
+ };
130
+ return result;
131
+ };
132
+
133
+ // === module main block (class definitions) ===
134
+
135
+ // === module exports block ===
136
+
137
+ exports.chkDTSysID = chkDTSysID;
138
+ exports.checkDTSysID = chkDTSysID;
139
+ exports.getDTSysName = getDTSysName;
140
+ exports.convStringToDTValue = convStringToDTValue;
141
+ exports.convDTValueToString = convDTValueToString;