The world clock column holds the current time of any place in the world. You can filter, read, update, and clear the world clock column via the API.

Filtering the world clock column

Using the items_page object, you can easily filter a board's items by specific columns or column values. The table below contains the world clock column's supported operators and compare values.

OperatorsCompare values
any_ofThe name of the timezone (as shown in the UI)
not_any_ofThe name of the timezone (as shown in the UI)

Examples

The following example returns all items on the specified board with a world clock column value of Samoa.

query {
  boards (ids: 1234567890) {
    items_page (query_params: {rules: [{column_id: "world_clock", compare_value: ["Samoa"], operator:any_of}]}) {
      items {
        id
        name
      }
    }
  }
}

Reading the world clock column

You can query the world clock column using the column_values object that enables you to return column-specific subfields by sending a fragment in your query. Values for the world clock column are of the WorldClockValue type.

query {
  items (ids:[1234567890, 9876543210]) {
    column_values {
      ... on WorldClockValue {
        text
        timezone
      }
    }
  }
}

Fields

FieldDescription
column Column!The column the value belongs to.
id ID!The column's unique identifier.
text StringThe column's value as text. This field will return "" if the column has an empty value.
timezone StringThe column's timezone.
type ColumnType!The column's type.
updated_at DateThe column's last updated date.
value JSONThe column's JSON-formatted raw value.

Updating the world clock column

You can update a world clock column using the change_multiple_column_values mutation and passing a JSON string in the column_values argument. Simple string updates are not supported.

JSON

To update a world clock column, send the time zone of the user as a string in continent/city form. Check out this mutation in action in our Postman library or follow along with these code samples!

mutation {
  change_multiple_column_values(item_id:9876543210, board_id:1234567890, column_values: "{\"world_clock\" : {\"timezone\" : \"Europe/London\"}}") {
    id
  }
}
fetch ("https://api.monday.com/v2", {
  method: 'post',
  headers: {
    'Content-Type': 'application/json',
    'Authorization' : 'YOUR_API_KEY'
  },
  body: JSON.stringify({
    query : "mutation ($myBoardId:Int!, $myItemId:Int!, $myColumnValues:JSON!) { change_multiple_column_values(item_id:$myItemId, board_id:$myBoardId, column_values: $myColumnValues) { id }}",
    variables : JSON.stringify({
      myBoardId: 1234567890,
      myItemId: 9876543210,
      myColumnValues: "{\"world_clock\" : {\"timezone\" : \"Europe/London\"}}"
    })
  })
})

Clearing the world clock column

You can also clear a world clock column using the change_multiple_column_values mutation and passing null or an empty object in the column_values argument.

mutation {
  change_multiple_column_values(item_id:9876543210, board_id:1234567890, column_values: "{\"world_clock\" : null}") {
    id
  }
}
fetch ("https://api.monday.com/v2", {
  method: 'post',
  headers: {
    'Content-Type': 'application/json',
    'Authorization' : 'YOUR_API_KEY_HERE'
  },
  body: JSON.stringify({
    query : "mutation ($myBoardId:Int!, $myItemId:Int!, $myColumnValues:JSON!) { change_multiple_column_values(item_id:$myItemId, board_id:$myBoardId, column_values: $myColumnValues) { id } }",
    variables : JSON.stringify({
      myBoardId: 1234567890,
      myItemId: 9876543210,
      myColumnValues: "{\"world_clock\" : null}"
    })
  })
})

πŸ“˜

Join our developer community!

We've created a community specifically for our devs where you can search through previous topics to find solutions, ask new questions, hear about new features and updates, and learn tips and tricks from other devs. Come join in on the fun! 😎