ASM #14946 - fix issue when timezone is not defined for any zone in a segment
Change-Id: I252f78cb9f5bf1cf556788c79fe14ad338b546aa Former-commit-id:03034f57c8
[formerly ef4c5307d5693abd834f4210e081fb8e3a21f90b] Former-commit-id:3b59050996
This commit is contained in:
parent
c1511407bc
commit
524fa004d3
1 changed files with 11 additions and 11 deletions
|
@ -38,7 +38,8 @@ from java.io import File
|
|||
# ------------ ---------- ----------- --------------------------
|
||||
# 05/29/08 njensen Initial Creation.
|
||||
# 12/10/14 #14946 ryu Add getTimeZones() function.
|
||||
#
|
||||
# 04/16/15 #14946 ryu Fix getTimeZones to return the office TZ if timezone
|
||||
# is not set for any zone in a segment.
|
||||
#
|
||||
#
|
||||
|
||||
|
@ -440,19 +441,18 @@ def getTimeZones(zones, officeTZ):
|
|||
timezones = []
|
||||
if zones is not None:
|
||||
for zone in JUtil.javaStringListToPylist(zones):
|
||||
area_dict = AreaDictionary.AreaDictionary.get(zone)
|
||||
if area_dict is None:
|
||||
continue
|
||||
tzs = area_dict.get("ugcTimeZone")
|
||||
if tzs is not None:
|
||||
if type(tzs) is str:
|
||||
tzs = [tzs]
|
||||
for tz in tzs:
|
||||
if tz not in timezones:
|
||||
timezones.append(tz)
|
||||
zdict = AreaDictionary.AreaDictionary.get(zone, {})
|
||||
tzs = zdict.get("ugcTimeZone", [])
|
||||
if type(tzs) is str:
|
||||
tzs = [tzs]
|
||||
for tz in tzs:
|
||||
if tz not in timezones:
|
||||
timezones.append(tz)
|
||||
if officeTZ in timezones and officeTZ != timezones[0]:
|
||||
timezones.remove(officeTZ)
|
||||
timezones.insert(0, officeTZ)
|
||||
if len(timezones) == 0:
|
||||
timezones.append(officeTZ)
|
||||
return JUtil.pylistToJavaStringList(timezones)
|
||||
|
||||
def reloadModule(moduleName):
|
||||
|
|
Loading…
Add table
Reference in a new issue