{"comment":{"created_at":"2011-10-22T18:38:20Z","body":"Thanks. :)\r\n\r\nHow about validation for such cases? The date and time field would have to be validated with their own set of rules. \r\n\r\nI haven't figured out where to hook in to cause the form validation to throw an error.\r\n\r\nI thought maybe I could make use of pre_validation and something like this:\r\n\r\n    public function pre_validation() {\r\n        parent::pre_validation();\r\n        $val = $this->val();\r\n        if(!$this->valid_date($val['date'])) {\r\n            $this->_field->error('Incorrect date format');\r\n        }\r\n        //same for time\r\n    }\r\n\r\nBut: \r\n\r\n1. it doesn't \"pick up\" as an error, the form validates, and ... \r\n2. it won't give me \"per field\" messages that I could use in the view.\r\n\r\nHere's the current code btw, if you're interested (as you can see it's not currently configurable):\r\nDriver: http://pastebin.com/P27cu8qK\r\nView: http://pastebin.com/0zfjiy1y\r\nOutputs something like this: http://goo.gl/SXqb9\r\n\r\n","updated_at":"2011-10-22T18:38:20Z","url":"https://api.github.com/repos/bmidget/kohana-formo/issues/comments/2492082","id":2492082,"user":{"gravatar_id":"ec6e3c5fba540ead4decf89198a962f0","avatar_url":"https://secure.gravatar.com/avatar/ec6e3c5fba540ead4decf89198a962f0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/phobia","id":262570,"login":"phobia"}},"action":"created","issue":{"number":146,"created_at":"2011-10-19T15:20:27Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi :)\r\n\r\nI'm trying to understand using Formo to create custom fields, to hopefully be able to contribute some drivers later on.\r\n\r\nNow, I want to create a \"datetime\" driver that takes one unix timestamp column in DB, and creates two fields for it; one for date, one for time.\r\n\r\nThe fields would need to be validated as valid date and time, and then on save the field should be merged together to create a unix timestamp again. \r\n\r\nIs this \"two fields for one\"-thing possible with Formo, and if so, do you have any thoughts on how it would be best to go about solving this?","comments":2,"title":"Custom driver - two fields for one (date & time)","updated_at":"2011-10-22T18:38:20Z","url":"https://api.github.com/repos/bmidget/kohana-formo/issues/146","id":1994959,"assignee":null,"milestone":null,"closed_at":null,"user":{"gravatar_id":"ec6e3c5fba540ead4decf89198a962f0","avatar_url":"https://secure.gravatar.com/avatar/ec6e3c5fba540ead4decf89198a962f0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/phobia","id":262570,"login":"phobia"},"html_url":"https://github.com/bmidget/kohana-formo/issues/146","labels":[],"state":"open"},"legacy":{"issue_id":1994959,"comment_id":2492082}}