Skip to main content
clarified my explanation
Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

You will need work thewith an interval slider in terms of AbsoluteTime values because the slidersuch sliders only workswork with numeric objects. Here is a demonstration where a interval slider has the behavior you want.

With[{
  min0 = AbsoluteTime @ DateObject[{2015, 3, 8, 10, 0, 0.}],
  max0 = AbsoluteTime @ DateObject[{2015, 3, 8, 12, 30, 0.}],
  minT = AbsoluteTime @ DateObject[{2015, 3, 8, 0, 0, 0.}],
  maxT = AbsoluteTime @ DateObject[{2015, 3, 8, 22, 30, 0.}]}, 
  Manipulate[
    DateString /@ span,
    {{span, {min0, max0}, "Interval"}, minT, maxT, 5 60, 
      ControlType -> IntervalSlider}]]

demo

You will need work the interval slider in terms of AbsoluteTime because the slider only works with numeric objects. Here is a demonstration.

With[{
  min0 = AbsoluteTime @ DateObject[{2015, 3, 8, 10, 0, 0.}],
  max0 = AbsoluteTime @ DateObject[{2015, 3, 8, 12, 30, 0.}],
  minT = AbsoluteTime @ DateObject[{2015, 3, 8, 0, 0, 0.}],
  maxT = AbsoluteTime @ DateObject[{2015, 3, 8, 22, 30, 0.}]}, 
  Manipulate[
    DateString /@ span,
    {{span, {min0, max0}, "Interval"}, minT, maxT, 5 60, 
      ControlType -> IntervalSlider}]]

demo

You will need work with an interval slider in terms of AbsoluteTime values because such sliders only work with numeric objects. Here is a demonstration where a interval slider has the behavior you want.

With[{
  min0 = AbsoluteTime @ DateObject[{2015, 3, 8, 10, 0, 0.}],
  max0 = AbsoluteTime @ DateObject[{2015, 3, 8, 12, 30, 0.}],
  minT = AbsoluteTime @ DateObject[{2015, 3, 8, 0, 0, 0.}],
  maxT = AbsoluteTime @ DateObject[{2015, 3, 8, 22, 30, 0.}]}, 
  Manipulate[
    DateString /@ span,
    {{span, {min0, max0}, "Interval"}, minT, maxT, 5 60, 
      ControlType -> IntervalSlider}]]

demo

Source Link
m_goldberg
  • 108.1k
  • 16
  • 104
  • 259

You will need work the interval slider in terms of AbsoluteTime because the slider only works with numeric objects. Here is a demonstration.

With[{
  min0 = AbsoluteTime @ DateObject[{2015, 3, 8, 10, 0, 0.}],
  max0 = AbsoluteTime @ DateObject[{2015, 3, 8, 12, 30, 0.}],
  minT = AbsoluteTime @ DateObject[{2015, 3, 8, 0, 0, 0.}],
  maxT = AbsoluteTime @ DateObject[{2015, 3, 8, 22, 30, 0.}]}, 
  Manipulate[
    DateString /@ span,
    {{span, {min0, max0}, "Interval"}, minT, maxT, 5 60, 
      ControlType -> IntervalSlider}]]

demo