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

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.

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.

  • Back to top