Small style changes.

This commit is contained in:
Norman Jäckel 2016-09-22 21:43:49 +02:00 committed by Norman Jäckel
parent 970f42cacb
commit 926516ac65
3 changed files with 7 additions and 9 deletions

View File

@ -9,7 +9,6 @@ def convert_duration(apps, schema_editor):
Item = apps.get_model('agenda', 'item')
for item in Item.objects.all():
duration = item.duration
item.duration_tmp = None
if is_int(duration):
# assuming that these are minutes
@ -26,9 +25,10 @@ def convert_duration(apps, schema_editor):
def is_int(s):
try:
int(s)
return True
except ValueError:
return False
else:
return True
class Migration(migrations.Migration):

View File

@ -129,7 +129,7 @@ angular.module('OpenSlidesApp.agenda.site', ['OpenSlidesApp.agenda'])
if (startTime) {
var timestamp = Date.parse(startTime) + totalDuration * 60 * 1000;
var endDate = new Date(timestamp);
var mm = ("0"+endDate.getMinutes()).slice(-2);
var mm = ("0" + endDate.getMinutes()).slice(-2);
var dateStr = endDate.getHours() + ':' + mm;
return dateStr;
} else {

View File

@ -433,10 +433,8 @@ angular.module('OpenSlidesApp.core', [
.filter('osMinutesToTime', [
function () {
return function (totalminutes) {
if (!totalminutes) {
return '';
} else {
var time = "";
var time = '';
if (totalminutes) {
if (totalminutes < 0) {
time = "-";
totalminutes = -totalminutes;
@ -444,10 +442,10 @@ angular.module('OpenSlidesApp.core', [
var hh = Math.floor(totalminutes / 60);
var mm = Math.floor(totalminutes % 60);
// Add leading "0" for double digit values
mm = ("0"+mm).slice(-2);
mm = ("0" + mm).slice(-2);
time += hh + ":" + mm;
return time;
}
return time;
};
}
])