2
* Copyright 2001-2005 Stephen Colebourne
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
8
* http://www.apache.org/licenses/LICENSE-2.0
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
16
package org.joda.time.chrono.gj;
20
* @author Brian S O'Neill
22
class TestJulianMonthOfYearField extends TestGJMonthOfYearField {
23
public TestJulianMonthOfYearField(TestJulianChronology chrono) {
27
public int get(long millis) {
28
return iChronology.gjFromMillis(millis)[1];
31
public long add(long millis, long value) {
32
int year = iChronology.year().get(millis);
33
int newYear = year + (int)TestGJChronology.div(value, 12);
43
int newMonth = get(millis) + (int)TestGJChronology.mod(value, 12);
52
int newDay = iChronology.dayOfMonth().get(millis);
53
millis = iChronology.getTimeOnlyMillis(millis)
54
+ iChronology.millisFromGJ(newYear, newMonth, newDay);
55
while (get(millis) != newMonth) {
56
millis = iChronology.dayOfYear().add(millis, -1);