diff --git a/office_hours.elements.inc b/office_hours.elements.inc
index 83cd0d0..b859ab9 100644
--- a/office_hours.elements.inc
+++ b/office_hours.elements.inc
@@ -35,12 +35,12 @@ function _office_hours_slot_process($element, &$form_state, $form) {
     '#type' => 'value',
     '#value' => $element['#weight'],
   );
+
   $settings = array(
-    '#granularity' => $element['#granularity'],
     '#valhrs' => $element['#valhrs'],
     '#hoursformat' => $element['#hoursformat'],
-    '#limitstart' => $element['#limitstart'],
-    '#limitend' => $element['#limitend'],
+    '#hours' => $element['#hours'],
+    '#minutes' => $element['#minutes'],
   );
 
   $element['starthours'] = array(
@@ -90,19 +90,14 @@ function _office_hours_select_value_callback($element, $input = FALSE, &$form_st
  * Process the hours selector element.
  */
 function _office_hours_select_process($element, &$form_state, $form) {
-  $minutes = date_minutes('i', FALSE, $element['#granularity']);
-  $hours = ($element['#hoursformat'] == 1) ? date_hours('g') : date_hours('H');
-  if (!empty($element['#limitstart']) || !empty($element['#limitend']) ) {
-    $hours = _office_hours_limit_hours($hours, $element['#limitstart'], $element['#limitend']);
-  }
   $element['hours'] = array(
     '#type' => 'select',
-    '#options' => drupal_map_assoc($hours),
+    '#options' => $element['#hours'],
     '#default_value' => $element['#value'][0],
   );
   $element['minutes'] = array(
     '#type' => 'select',
-    '#options' => drupal_map_assoc($minutes),
+    '#options' => $element['#minutes'],
     '#default_value' => $element['#value'][1],
   );
   if ($element['#hoursformat'] == 1) {
@@ -153,22 +148,15 @@ function _office_hours_slot_validate($element, &$form_state) {
 
   $error_text = '';
   if (!empty($item['starthours']) xor !empty($item['endhours']) ) {
-    $error_text = 'Both Opening hours and Closing hours must be set.';
+    $error_text = t('Both Opening hours and Closing hours must be set.');
   }
   elseif ( ($element['#valhrs']) && ($item['starthours'] > $item['endhours']) ) {
-    $error_text = 'Closing hours are earlier than opening hours.';
-  }
-  elseif (!empty($element['#limitstart']) || !empty($element['#limitend'])) {
-    $starthours = (int) substr($item['starthours'], 0, 2);
-    $endhours = (int) substr($item['endhours'], 0, 2);
-    if ( ($starthours && $element['#limitstart'] > $starthours) || ($endhours && $element['#limitend'] < $endhours) ) {
-      $error_text = 'Opening hours are outside limits' . ' (' . $element['#limitstart'] . ' - ' . $element['#limitend'] . ').';
-    }
+    $error_text = t('Closing hours are earlier than opening hours.');
   }
 
   if ($error_text) {
     $weekdays = date_week_days(TRUE);
-    $error_text  = t($weekdays[$delta / 2]) . ': ' . t($error_text);
+    $error_text  = $weekdays[$delta / 2] . ': ' . $error_text;
 
     form_error($element, check_plain($error_text));
   }
diff --git a/office_hours.module b/office_hours.module
index 294c842..d3b90f6 100644
--- a/office_hours.module
+++ b/office_hours.module
@@ -586,12 +586,33 @@ function office_hours_field_widget_form(&$form, &$form_state, $field, $instance,
   }
 
   $items = _office_hours_arrange_items($items);
+
+  // Use Date API to obtain valid minutes.
+  $minutes = date_minutes('i', FALSE, $field['settings']['granularity']);
+
+  // Calculate valid hours. Date API doesn't provide a straigh method for this.
+  $start = !empty($field['settings']['limitstart'])?$field['settings']['limitstart']:0; //@todo #limitstart should be 0 by default.
+
+  // End hour depends on hour format (12/24).
+  if (!empty($field['settings']['limitend'])) {
+    $end = $field['settings']['limitend'];
+  }
+  else {
+    $end = ($field['settings']['hoursformat'] == 1) ? 12 : 24;
+  }
+  $hours = array('' => '');
+  for ($i=$start;$i<=$end;$i++) {
+    $hours[$i] = $i < 10 && ($field['settings']['hoursformat'] == 0) ? "0$i" : $i;
+  }
+
   $element += array(
     '#type' => 'office_hours_slot',
     '#default_value' => isset($items[$delta]['starthours']) ? $items[$delta] : NULL,
+    '#hours' => drupal_map_assoc($hours),
+    '#minutes' => drupal_map_assoc($minutes),
   );
 
-  $field_settings = array('hoursformat', 'granularity', 'addhrs', 'valhrs', 'limitstart', 'limitend');
+  $field_settings = array('hoursformat', 'addhrs', 'valhrs');
   foreach ($field_settings as $key) {
     $element['#' . $key] = $field['settings'][$key];
   }
@@ -651,16 +672,6 @@ function _office_hours_show_ampm($hours) {
   return $hours;
 }
 
-function _office_hours_limit_hours($hours, $limitstart=0, $limitend=25) {
-  $limitedhours[] = '';
-  foreach ($hours as $key => $hour) {
-    if ($hour >= $limitstart && $hour <= $limitend) {
-      $limitedhours[$key] = $hour;
-    }
-  }
-  return $limitedhours;
-}
-
 function _office_hours_arrange_items($items) {
   $days = array();
   foreach ($items as $item) {
