- datetime ||= nil - datetime_str = datetime.utc.iso8601 if datetime - if editable && f = form_builder .row.datetime-attribute{class: form_id} = f.hidden_field(attr_name, value: datetime_str) - # TODO(jon): Figure out a better way to do transforms. This works for now though. = f.hidden_field("transforms[#{attr_name}]", value: "DateTime#parse") .col-xs-12.col-md-4 .input-group.pikadate %input.form-control{type: :text, value: datetime_str, id: "#{form_id}-date"} %span.input-group-addon %span.glyphicon.glyphicon-calendar .col-xs-12.col-md-4 .input-group.clockpicker{"data-align" => "top", "data-autoclose" => "true", "data-placement" => "right"} %input.form-control{:type => "text", :value => datetime_str, id: "#{form_id}-time"} %span.input-group-addon %span.glyphicon.glyphicon-time .col-xs-12.col-md-4 %small Date & Time are shown in UTC. If not time is provided, the current time in UTC will be used. - content_for(:javascript) do :javascript $(document).ready(function() { window.Upmin.Attributes.DateTime("#{form_id}"); }); - else %p.well -# TODO(jon): Make this show an uneditable date and time field. = datetime