Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 523 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Populating timetoday columns with vars

#1
Why does this work:

table.setCell(0,0,[18,12,31]);

and this doesn't

strTime="18:12:31";
time = strTime.split(":");
table.setCell(0,0,time);


the column has been defined by

table.addColumn('timeofday','Time');
Reply

#2
When you do a

strTime.split(":");

the result is an

Array [ "18", "12", "31" ]

which contains strings, not integers. Yet, the `timeofday` type [requires an array of four numbers][1]:

> If the column type is 'timeofday', the value is an array of four
> numbers: [hour, minute, second, milliseconds].

To obtain an array of `Number`s, you could use

strTime.split(":").map(Number)

which applies the `Number`-function to each string element. This returns a Number object. The `map` applies it recursively to each element of the array.


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through