{"action":"created","issue":{"url":"https://api.github.com/repos/dimagi/commcare-hq/issues/12670","repository_url":"https://api.github.com/repos/dimagi/commcare-hq","labels_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/12670/labels{/name}","comments_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/12670/comments","events_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/12670/events","html_url":"https://github.com/dimagi/commcare-hq/pull/12670","id":168534186,"number":12670,"title":"Add a diff seconds expression","user":{"login":"sheelio","id":3524390,"avatar_url":"https://avatars.githubusercontent.com/u/3524390?v=3","gravatar_id":"","url":"https://api.github.com/users/sheelio","html_url":"https://github.com/sheelio","followers_url":"https://api.github.com/users/sheelio/followers","following_url":"https://api.github.com/users/sheelio/following{/other_user}","gists_url":"https://api.github.com/users/sheelio/gists{/gist_id}","starred_url":"https://api.github.com/users/sheelio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheelio/subscriptions","organizations_url":"https://api.github.com/users/sheelio/orgs","repos_url":"https://api.github.com/users/sheelio/repos","events_url":"https://api.github.com/users/sheelio/events{/privacy}","received_events_url":"https://api.github.com/users/sheelio/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/dimagi/commcare-hq/labels/No%20lint%20errors","name":"No lint errors","color":"bfe5bf"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-31T19:36:14Z","updated_at":"2016-08-08T15:06:23Z","closed_at":"2016-08-01T14:02:48Z","pull_request":{"url":"https://api.github.com/repos/dimagi/commcare-hq/pulls/12670","html_url":"https://github.com/dimagi/commcare-hq/pull/12670","diff_url":"https://github.com/dimagi/commcare-hq/pull/12670.diff","patch_url":"https://github.com/dimagi/commcare-hq/pull/12670.patch"},"body":"Need this for ICDS (to calculate timespent on a form).\r\n\r\n@czue @NoahCarnahan "},"comment":{"url":"https://api.github.com/repos/dimagi/commcare-hq/issues/comments/238266799","html_url":"https://github.com/dimagi/commcare-hq/pull/12670#issuecomment-238266799","issue_url":"https://api.github.com/repos/dimagi/commcare-hq/issues/12670","id":238266799,"user":{"login":"snopoke","id":249606,"avatar_url":"https://avatars.githubusercontent.com/u/249606?v=3","gravatar_id":"","url":"https://api.github.com/users/snopoke","html_url":"https://github.com/snopoke","followers_url":"https://api.github.com/users/snopoke/followers","following_url":"https://api.github.com/users/snopoke/following{/other_user}","gists_url":"https://api.github.com/users/snopoke/gists{/gist_id}","starred_url":"https://api.github.com/users/snopoke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snopoke/subscriptions","organizations_url":"https://api.github.com/users/snopoke/orgs","repos_url":"https://api.github.com/users/snopoke/repos","events_url":"https://api.github.com/users/snopoke/events{/privacy}","received_events_url":"https://api.github.com/users/snopoke/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T15:06:22Z","updated_at":"2016-08-08T15:06:22Z","body":"@czue @sheelio FYI this was already possible with the `timedelta_to_seconds` function:\r\n```\r\n{\r\n    \"column_id\": \"duration\",\r\n    \"datatype\": \"integer\",\r\n    \"display_name\": \"Duration\",\r\n    \"expression\": {\r\n        \"type\": \"evaluator\",\r\n        \"statement\": \"timedelta_to_seconds(time_end - time_start)\",\r\n        \"context_variables\": {\r\n            \"time_start\": {\r\n                \"datatype\": \"datetime\",\r\n                \"type\": \"property_path\",\r\n                \"property_path\": [\r\n                    \"form\",\r\n                    \"meta\",\r\n                    \"timeStart\"\r\n                ]\r\n            },\r\n            \"time_end\": {\r\n                \"datatype\": \"datetime\",\r\n                \"type\": \"property_path\",\r\n                \"property_path\": [\r\n                    \"form\",\r\n                    \"meta\",\r\n                    \"timeEnd\"\r\n                ]\r\n            }\r\n        }\r\n    },\r\n    \"type\": \"expression\"\r\n},\r\n```"}}
{"actor":{"display_login":"snopoke"}}