diff --git a/app/models/task.rb b/app/models/task.rb
index <HASH>..<HASH> 100644
--- a/app/models/task.rb
+++ b/app/models/task.rb
@@ -2,11 +2,26 @@ class Task < ActiveRecord::Base
   belongs_to :project
   belongs_to :person
   
+  attr_accessor :minutes, :hours
+  
   validates :project, :presence => true
   validates :person,  :presence => true
   validates :when,    :presence => true
-  validates :from,    :presence => true
-  validates :to,      :presence => true
+  validates :from,    :presence => true, :unless => :hours_minutes
+  validates :to,      :presence => true, :unless => :hours_minutes
+  validates_numericality_of :hours,   :only_integer => true, :unless => :from
+  validates_numericality_of :minutes, :only_integer => true, :unless => :from
+  
+  before_save :calculate_hours, :if => :hours_minutes
+  
+  def hours_minutes
+    minutes || hours
+  end
+  
+  def calculate_hours
+    self.from = DateTime.now
+    self.to = self.from + hours.to_i.hours + minutes.to_i.minutes
+  end
   
   # The duration of the task in minutes
   def duration
Proper validations added for the times.