diff options
author | Kalyan Prasad Tatavarthi | 2019-03-20 08:53:57 +0000 |
---|---|---|
committer | Dani Megert | 2019-03-20 13:27:41 +0000 |
commit | 0a8ebd58cb4fbb2a64f8b96360a25bed561aaa88 (patch) | |
tree | f04009d34a0c238a39577fda22fa24e6ab34b74d /bundles/org.eclipse.team.cvs.ui/src | |
parent | bc1f4989372b140b7f271e300da7224825ea1911 (diff) | |
download | eclipse.platform.team-0a8ebd58cb4fbb2a64f8b96360a25bed561aaa88.tar.gz eclipse.platform.team-0a8ebd58cb4fbb2a64f8b96360a25bed561aaa88.tar.xz eclipse.platform.team-0a8ebd58cb4fbb2a64f8b96360a25bed561aaa88.zip |
Bug 544904: Japanese Calendar - Wrong Japanese era of Data tag in CVSI20190326-2305I20190326-1800I20190325-1800I20190325-0105I20190324-1800I20190323-1800I20190322-1800I20190321-1800I20190321-0435I20190321-0245I20190320-1800
repos view
Change-Id: I91f6bad5f7c2abcdbb599860bcc2aed65a606ce7
Signed-off-by: Kalyan Prasad Tatavarthi <kalyan_prasad@in.ibm.com>
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src')
-rw-r--r-- | bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/DateTagDialog.java | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/DateTagDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/DateTagDialog.java index 1d9a294ba..06572032b 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/DateTagDialog.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/DateTagDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2019 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -41,6 +41,11 @@ public class DateTagDialog extends TrayDialog { public class DateArea extends DialogArea { private DateTime date; + /** + * This is the minimum year that is accepted by {@link DateTime#setYear}. + */ + private static final int DateTime_MIN_YEAR = 1752; + public void createArea(Composite parent) { Composite composite = createComposite(parent, 2, false); initializeDialogUnits(composite); @@ -60,8 +65,16 @@ public class DateTagDialog extends TrayDialog { } public void adjustCalendar(Calendar calendar) { + int dateYear = date.getYear(); + int todaysYear = calendar.get(Calendar.YEAR); + if (todaysYear < DateTime_MIN_YEAR) { + // year would be ignored by DateTime if it is less than MIN_YEAR + // The code below is to specify the correct year as per the calendar chosen + int extended_year = calendar.get(Calendar.EXTENDED_YEAR); + dateYear = todaysYear + (dateYear - extended_year); + } calendar.set( - date.getYear(), + dateYear, date.getMonth(), date.getDay(), 0,0,0); |