* tweak date offset logic

This commit is contained in:
Seth Call 2014-06-25 21:50:20 -05:00
parent 20e4a39a61
commit f9ce995a8f
4 changed files with 11 additions and 10 deletions

View File

@ -399,6 +399,9 @@ module JamRuby
day = Date.parse(day)
next_day = day + 1
timezone_offset = timezone_offset.to_i
if timezone_offset > 0
timezone_offset = "+#{timezone_offset}"
end
query = query.where("scheduled_start BETWEEN TIMESTAMP WITH TIME ZONE '#{day} 00:00:00#{timezone_offset}'
AND TIMESTAMP WITH TIME ZONE '#{next_day} 00:00:00#{timezone_offset}'")
rescue Exception => e

View File

@ -651,9 +651,7 @@ module JamRuby
day = Date.parse(day)
next_day = day + 1
timezone_offset = timezone_offset.to_i
if timezone_offset == 0
timezone_offset = '' # no offset to specify in this case
elsif timezone_offset > 0
if timezone_offset > 0
timezone_offset = "+#{timezone_offset}"
end
query = query.where("scheduled_start BETWEEN TIMESTAMP WITH TIME ZONE '#{day} 00:00:00#{timezone_offset}'

View File

@ -119,12 +119,12 @@
function afterShow(data) {
if(!context.JK.JamServer.connected) {
promptLeave = false;
app.notifyAlert("Not Connected", 'To create or join a session, you must be connected to the server.');
window.location = '/client#/home'
return;
}
if(!context.JK.JamServer.connected) {
promptLeave = false;
app.notifyAlert("Not Connected", 'To create or join a session, you must be connected to the server.');
window.location = '/client#/home'
return;
}
gearUtils.guardAgainstInvalidConfiguration(app)
.fail(function() {

View File

@ -344,7 +344,7 @@ def schedule_session(options = {})
find('.btn-next', text: 'PUBLISH SESSION').trigger(:click)
find('h2', text: 'create session')
sleep 1 # to get rid of this, we need to verify that the URL is /client#/home.. otherwise intermittent fails
end
end