= JodaDateTimes
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Returns a random _DateTime_ , optionally based on the current time but constrained by a _Period_ .

The current time ('now') is obtained from the _org.apache.causeway.applib.services.clock.ClockService_ .

== API

[source,java]
.JodaDateTimes.java
----
class JodaDateTimes {
  JodaDateTimes(FakeDataService fakeDataService)
  DateTime around(Period period)     // <.>
  DateTime before(Period period)     // <.>
  DateTime after(Period period)     // <.>
  DateTime any()     // <.>
}
----

<.> xref:#around_Period[around(Period)]
+
--
Returns a random date/time either before or after 'now', within the specified _java.time.Period_ .
--
<.> xref:#before_Period[before(Period)]
+
--
Returns a random date/time some time before 'now', within the specified _java.time.Period_ .
--
<.> xref:#after_Period[after(Period)]
+
--
Returns a random date/time some time after 'now', within the specified _java.time.Period_ .
--
<.> xref:#any_[any()]
+
--
Returns a random date/time 5 years around 'now'.
--

== Members

[#around_Period]
=== around(Period)

Returns a random date/time either before or after 'now', within the specified _java.time.Period_ .

[#before_Period]
=== before(Period)

Returns a random date/time some time before 'now', within the specified _java.time.Period_ .

[#after_Period]
=== after(Period)

Returns a random date/time some time after 'now', within the specified _java.time.Period_ .

[#any_]
=== any()

Returns a random date/time 5 years around 'now'.
