Kineviz Community Forum

Would you like to react to this message? Create an account in a few clicks or log in to continue.
Kineviz Community Forum

Welcome to the Kineviz Community! Discuss GraphXR and more.


    Conver date to day of the week using connector => f(x)

    avatar
    wei


    Posts : 1
    Join date : 2019-08-19

    Conver date to day of the week using connector => f(x) Empty Conver date to day of the week using connector => f(x)

    Post by wei Mon Aug 19, 2019 3:30 pm

    This example uses Russian Twitter Troll data set. The Tweet label has property created_at, let's create a new property "created_at_dow" that is day of the week of the tweet.
    Conver date to day of the week using connector => f(x) Graphx11

    From Connector=>f(x), select Tweet label, add ceated_at for the conversion, and use "created_at_dow" as mapping result,

    Then choose toCustom, modify the code as:

    (propVal,props) => (new Date(propVal)).getDay()

    This will first create a Date object from created_at (propVal), and then compute day of the week using function getDay() and save to "created_at_dow" property.

      Current date/time is Thu May 02, 2024 8:23 am