Browse Source

Attempting to go the proper way to fix dates

Still need to fix the bug/issue in netzke where it renders without the
timezone
denney-fix-saving-dates
Jason Denney 11 years ago
parent
commit
517950c42c
  1. 7
      app/assets/javascripts/panel.js
  2. 15
      db/migrate/20140504154355_add_timezones_to_logs.rb
  3. 2
      db/schema.rb

7
app/assets/javascripts/panel.js

@ -22,6 +22,7 @@ Ext.define('Ext.ux.form.field.DateTime', {
dateSubmitFormat: 'Y-m-d', dateSubmitFormat: 'Y-m-d',
timeFormat: 'H:i:s', timeFormat: 'H:i:s',
timeSubmitFormat: 'H:i:s', timeSubmitFormat: 'H:i:s',
submitFormat: 'c',
dateConfig:{}, dateConfig:{},
timeConfig:{}, timeConfig:{},
@ -184,8 +185,10 @@ Ext.define('Ext.ux.form.field.DateTime', {
var me = this var me = this
,format = me.getFormat() ,format = me.getFormat()
,value = me.getValue(); ,value = me.getValue();
console.log(value);
return value ? Ext.Date.format(value, format) : null; console.log(format);
console.log("formatted: " + Ext.Date.format(value, this.submitFormat));
return value ? Ext.Date.format(value, this.submitFormat) : null;
}, },
setValue: function(value){ setValue: function(value){

15
db/migrate/20140504154355_add_timezones_to_logs.rb

@ -0,0 +1,15 @@
class AddTimezonesToLogs < ActiveRecord::Migration
def up
change_table :logs do |t|
t.change :start_date, :timestamptz
t.change :end_date, :timestamptz
end
end
def down
change_table :logs do |t|
t.change :start_date, :timestamp
t.change :end_date, :timestamp
end
end
end

2
db/schema.rb

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20131019170248) do ActiveRecord::Schema.define(:version => 20140504154355) do
create_table "bike_actions", :force => true do |t| create_table "bike_actions", :force => true do |t|
t.string "action", :limit => 128, :null => false t.string "action", :limit => 128, :null => false

Loading…
Cancel
Save