{"action":"created","issue":{"url":"https://api.github.com/repos/NightCatSama/vue-slider-component/issues/195","repository_url":"https://api.github.com/repos/NightCatSama/vue-slider-component","labels_url":"https://api.github.com/repos/NightCatSama/vue-slider-component/issues/195/labels{/name}","comments_url":"https://api.github.com/repos/NightCatSama/vue-slider-component/issues/195/comments","events_url":"https://api.github.com/repos/NightCatSama/vue-slider-component/issues/195/events","html_url":"https://github.com/NightCatSama/vue-slider-component/issues/195","id":327755039,"node_id":"MDU6SXNzdWUzMjc3NTUwMzk=","number":195,"title":"formatter - using function examples request","user":{"login":"SMen1","id":8385115,"node_id":"MDQ6VXNlcjgzODUxMTU=","avatar_url":"https://avatars0.githubusercontent.com/u/8385115?v=4","gravatar_id":"","url":"https://api.github.com/users/SMen1","html_url":"https://github.com/SMen1","followers_url":"https://api.github.com/users/SMen1/followers","following_url":"https://api.github.com/users/SMen1/following{/other_user}","gists_url":"https://api.github.com/users/SMen1/gists{/gist_id}","starred_url":"https://api.github.com/users/SMen1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SMen1/subscriptions","organizations_url":"https://api.github.com/users/SMen1/orgs","repos_url":"https://api.github.com/users/SMen1/repos","events_url":"https://api.github.com/users/SMen1/events{/privacy}","received_events_url":"https://api.github.com/users/SMen1/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-05-30T14:24:05Z","updated_at":"2018-06-01T13:27:02Z","closed_at":"2018-06-01T13:27:02Z","author_association":"NONE","body":"Thank you for your excellent component and hard work!\r\n\r\nI am requesting help or examples regarding the tooltip formatter.\r\n\r\nIn your documentation you refer to this:\r\n\r\nformatter: (v) => `¥${v}`\r\n\r\nbut I can see no advantage over \r\n\r\nformatter='¥{value}'\r\n\r\nwhich is documented in the examples while I cannot find an example using =>.\r\n\r\n\r\nI am expecting to be able to pass an additional argument / call a method but I am having difficulties.\r\n\r\nI am adding duration to start time to give me \"from time to time\" in the tooltip.\r\n\r\nThis code below works fine but I doubt very much that it is correct practice, but being new to Vue and ES6  after many attempts this is what I have fallen back on:\r\n\r\n\r\nformatter: (v) => {\r\n        let duration = document.getElementById(\"duration\").value;\r\n        let v2 = v + +duration\r\n        let h = Math.floor(v / 60);\r\n        let m = v % 60;\r\n        h = h < 10 ? '0' + h : h;\r\n        m = m < 10 ? '0' + m : m;\r\n        let h2 = Math.floor(v2 / 60);\r\n        let m2 = v2 % 60;\r\n        h2 = h2 < 10 ? '0' + h2 : h2;\r\n        m2 = m2 < 10 ? '0' + m2 : m2;\r\n\r\n        return `From ${h}:${m} to ${h2}:${m2}`\r\n        }\r\n\r\nI only want one slider, not two, and for performance I really need to use lazy - doing this in the tooltip seems the best approach performance wise.\r\n\r\n\r\nI also run a variant of the above as a method like so:\r\n\r\n\r\nconvertMinsToHrsMins(mins) {\r\n      let h = Math.floor(mins / 60);\r\n      let m = mins % 60;\r\n      h = h < 10 ? '0' + h : h;\r\n      m = m < 10 ? '0' + m : m;\r\n      return `${h}:${m}`;\r\n    },\r\n\r\nbut cannot call it. I must be missing something pretty obvious, so apologies. \r\n\r\nAny guidance very much appreciated.\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NightCatSama/vue-slider-component/issues/comments/393879950","html_url":"https://github.com/NightCatSama/vue-slider-component/issues/195#issuecomment-393879950","issue_url":"https://api.github.com/repos/NightCatSama/vue-slider-component/issues/195","id":393879950,"node_id":"MDEyOklzc3VlQ29tbWVudDM5Mzg3OTk1MA==","user":{"login":"SMen1","id":8385115,"node_id":"MDQ6VXNlcjgzODUxMTU=","avatar_url":"https://avatars0.githubusercontent.com/u/8385115?v=4","gravatar_id":"","url":"https://api.github.com/users/SMen1","html_url":"https://github.com/SMen1","followers_url":"https://api.github.com/users/SMen1/followers","following_url":"https://api.github.com/users/SMen1/following{/other_user}","gists_url":"https://api.github.com/users/SMen1/gists{/gist_id}","starred_url":"https://api.github.com/users/SMen1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SMen1/subscriptions","organizations_url":"https://api.github.com/users/SMen1/orgs","repos_url":"https://api.github.com/users/SMen1/repos","events_url":"https://api.github.com/users/SMen1/events{/privacy}","received_events_url":"https://api.github.com/users/SMen1/received_events","type":"User","site_admin":false},"created_at":"2018-06-01T13:27:02Z","updated_at":"2018-06-01T13:27:02Z","author_association":"NONE","body":"Thank you. :-) \r\n\r\nI needed the heads up, as I just 'dived in' using the CDN. You have been a great help."}}
{"actor":{"display_login":"SMen1"}}