Skip to content

Commit

Permalink
added a datepicker to the event form
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Krebs committed Dec 20, 2011
1 parent 5957991 commit 38eb6be
Show file tree
Hide file tree
Showing 22 changed files with 1,400 additions and 3 deletions.
1 change: 1 addition & 0 deletions calendar/app/views/Events/add.html
Expand Up @@ -2,6 +2,7 @@
#{set title:calendar.name/}
#{set 'moreStyles'}
<link rel="stylesheet" href="@{'/public/stylesheets/event.css'}" type="text/css" media="screen" charset="${_response_encoding}">
<link rel="stylesheet" href="@{'/public/stylesheets/jquery-ui-1.8.16.custom.css'}" type="text/css" media="screen" />
#{/set}

<h2 class="title">Add an event to ${calendar.name}</h2>
Expand Down
1 change: 1 addition & 0 deletions calendar/app/views/Events/edit.html
Expand Up @@ -2,6 +2,7 @@
#{set title:event.name/}
#{set 'moreStyles'}
<link rel="stylesheet" href="@{'/public/stylesheets/event.css'}" type="text/css" media="screen" charset="${_response_encoding}">
<link rel="stylesheet" href="@{'/public/stylesheets/jquery-ui-1.8.16.custom.css'}" type="text/css" media="screen" />
#{/set}

<h2 class="title">Edit Event</h2>
Expand Down
6 changes: 4 additions & 2 deletions calendar/app/views/tags/event-form.html
Expand Up @@ -2,6 +2,8 @@

#{set 'moreScripts'}
<script src="@{'/public/javascripts/event.js'}"></script>
<script src="@{'/public/javascripts/jquery-ui-1.8.16.custom.min.js'}" ></script>
<script src="@{'/public/javascripts/jquery.ui.datepicker-de-CH.js'}" ></script>
#{/set}

#{ifErrors}
Expand Down Expand Up @@ -29,7 +31,7 @@
<p>
#{field 'startDay'}
<label for="startDay">Start</label>
<input type="text" name="${field.name}" id="${field.name}" onblur="javascript:checkLocationCollision();checkEventCollision();" value="#{ifErrors}${flash.startDay}#{/ifErrors}#{else}#{if _event}${_event?.startDate?.toString('dd.MM.yyyy')}#{/if}#{else}${String.format("%02d", _selected.getDayOfMonth())}.${String.format("%02d", _selected.getMonthOfYear())}.${_selected.getYear()}#{/else}#{/else}"/>
<input class="datepicker" type="text" name="${field.name}" id="${field.name}" onblur="javascript:checkLocationCollision();checkEventCollision();" value="#{ifErrors}${flash.startDay}#{/ifErrors}#{else}#{if _event}${_event?.startDate?.toString('dd.MM.yyyy')}#{/if}#{else}${String.format("%02d", _selected.getDayOfMonth())}.${String.format("%02d", _selected.getMonthOfYear())}.${_selected.getYear()}#{/else}#{/else}"/>
#{/field}
#{field 'startTime'}
<label for="startTime" class="time">Time</label>
Expand All @@ -40,7 +42,7 @@
<p>
#{field 'endDay'}
<label for="endDay">End</label>
<input type="text" name="${field.name}" id="${field.name}" onblur="javascript:checkLocationCollision();checkEventCollision();" value="#{ifErrors}${flash.endDay}#{/ifErrors}#{else}#{if _event}${_event?.endDate?.toString('dd.MM.yyyy')}#{/if}#{else}${String.format("%02d", _selected.plusHours(1).getDayOfMonth())}.${String.format("%02d", _selected.plusHours(1).getMonthOfYear())}.${_selected.plusHours(1).getYear()}#{/else}#{/else}"/>
<input class="datepicker" type="text" name="${field.name}" id="${field.name}" onblur="javascript:checkLocationCollision();checkEventCollision();" value="#{ifErrors}${flash.endDay}#{/ifErrors}#{else}#{if _event}${_event?.endDate?.toString('dd.MM.yyyy')}#{/if}#{else}${String.format("%02d", _selected.plusHours(1).getDayOfMonth())}.${String.format("%02d", _selected.plusHours(1).getMonthOfYear())}.${_selected.plusHours(1).getYear()}#{/else}#{/else}"/>
#{/field}
#{field 'endTime'}
<label for="endTime" class="time">Time</label>
Expand Down
13 changes: 12 additions & 1 deletion calendar/public/javascripts/event.js
Expand Up @@ -76,4 +76,15 @@ function setupEventForm() {
$('#repeating-details').show('slow');
}
});
}

$.datepicker.setDefaults(
$.extend(
{'dateFormat':'dd.mm.yyyy'},
$.datepicker.regional['de-CH']
)
);

$(function() {
$(".datepicker").datepicker();
});
}
791 changes: 791 additions & 0 deletions calendar/public/javascripts/jquery-ui-1.8.16.custom.min.js

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions calendar/public/javascripts/jquery.ui.datepicker-de-CH.js
@@ -0,0 +1,23 @@
/* Swiss-German initialisation for the jQuery UI date picker plugin. */
/* By Douglas Jose & Juerg Meier. */
jQuery(function($){
$.datepicker.regional['de-CH'] = {
closeText: 'schliessen',
prevText: '&#x3c;zurück',
nextText: 'nächster&#x3e;',
currentText: 'heute',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Dez'],
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
weekHeader: 'Wo',
dateFormat: 'dd.mm.yy',
firstDay: 1,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$.datepicker.setDefaults($.datepicker.regional['de-CH']);
});
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
568 changes: 568 additions & 0 deletions calendar/public/stylesheets/jquery-ui-1.8.16.custom.css

Large diffs are not rendered by default.

0 comments on commit 38eb6be

Please sign in to comment.