From 30a80edb3d4d7626afc4e0e2a5ae2e632e64ef6b Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 14 Sep 2014 12:37:23 +0200 Subject: [PATCH] datetimepicker fix --- app/assets/javascripts/neuigkeiten.js.coffee | 4 ++++ app/views/fetprofiles/_interninfo.html.erb | 4 +++- app/views/neuigkeiten/_form.html.erb | 8 +++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/neuigkeiten.js.coffee b/app/assets/javascripts/neuigkeiten.js.coffee index 7615679..5e993f2 100755 --- a/app/assets/javascripts/neuigkeiten.js.coffee +++ b/app/assets/javascripts/neuigkeiten.js.coffee @@ -1,3 +1,7 @@ + # Place all the behaviors and hooks related to the matching controller here. # All this logic will automatically be available in application.js. # You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ +$ -> + `$('.datetimepicker').datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): '' })` + return \ No newline at end of file diff --git a/app/views/fetprofiles/_interninfo.html.erb b/app/views/fetprofiles/_interninfo.html.erb index ab6f272..1904a52 100644 --- a/app/views/fetprofiles/_interninfo.html.erb +++ b/app/views/fetprofiles/_interninfo.html.erb @@ -1,5 +1,7 @@

-Geburtstag <%= I18n.l(interninfo.birthday,format: :short) unless interninfo.birthday.nil?%> +<% unless interninfo.birthday.nil? %> +Geburtstag <%= I18n.l(interninfo.birthday,format: :short) %> +<% end %>

Adresse: diff --git a/app/views/neuigkeiten/_form.html.erb b/app/views/neuigkeiten/_form.html.erb index e92ea7b..6d3550d 100755 --- a/app/views/neuigkeiten/_form.html.erb +++ b/app/views/neuigkeiten/_form.html.erb @@ -34,7 +34,9 @@ <% end %> + $(document).ready(function(){ + $('.datetimepicker').map($(this).datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""})) + }) + $(document).ready(function(){$('.datetimepicker').datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""})}) + <%= tinymce %>