datetimepicker fix

This commit is contained in:
Andreas Stephanides
2014-09-14 12:37:23 +02:00
parent 4135260421
commit 6c8bd756e5
3 changed files with 12 additions and 4 deletions

View File

@@ -1,3 +1,7 @@
# Place all the behaviors and hooks related to the matching controller here. # Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js. # All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ # 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

View File

@@ -1,5 +1,7 @@
<p> <p>
<b>Geburtstag</b> <%= I18n.l(interninfo.birthday,format: :short) unless interninfo.birthday.nil?%> <% unless interninfo.birthday.nil? %>
<b>Geburtstag</b> <%= I18n.l(interninfo.birthday,format: :short) %>
<% end %>
</p> </p>
<p> <p>
<b>Adresse:</b> <b>Adresse:</b>

View File

@@ -34,7 +34,9 @@
<% end %> <% end %>
</div> </div>
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
$('.datetimepicker').map($(this).datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""})) $('.datetimepicker').map($(this).datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""}))
})</script> })
$(document).ready(function(){$('.datetimepicker').datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""})})
</script>
<%= tinymce %> <%= tinymce %>