@@ -3760,7 +3760,13 @@ def _rebuild_workspace_lunar_return_child(self, current_chart, base_chart, targe
37603760 place = getattr(current_chart, 'place', None) or base_chart.place
37613761 time = chart.Time(t1, t2, t3, t4, t5, t6, False, base_chart.time.cal, chart.Time.GREENWICH, True, 0, 0, False, place, False)
37623762 revolution = chart.Chart(base_chart.name, base_chart.male, time, place, chart.Chart.LUNAR, '', self.options, False)
3763- display_dt = self._revolution_display_datetime(base_chart, t1, t2, t3, t4, t5, t6, plus=True, zh=0, zm=0, daylight=False)
3763+ display_dt = self._revolution_display_datetime(
3764+ base_chart, t1, t2, t3, t4, t5, t6,
3765+ plus=True,
3766+ zh=getattr(base_chart.time, 'zh', 0),
3767+ zm=getattr(base_chart.time, 'zm', 0),
3768+ daylight=getattr(base_chart.time, 'daylightsaving', False),
3769+ )
37643770 return (revolution, display_dt)
37653771
37663772 def _supplementary_launch_context_for_session(self, feature_kind, chart_session_obj, fallback_chart=None):
@@ -6542,6 +6548,9 @@ def _workspace_open_planetary_return_from_document(self, document_id, planet_typ
65426548 result.binding.parent_source_datetime = self._datetime_to_display_tuple(ctx['source_datetime'])
65436549 place = supplementary_adapter.payload_to_place(result.binding.retained_state.get('place_payload'), fallback=base_chart.place)
65446550 plus = bool(result.binding.retained_state.get('plus', True))
6551+ zh = int(result.binding.retained_state.get('zh', getattr(base_chart.time, 'zh', 0) or 0))
6552+ zm = int(result.binding.retained_state.get('zm', getattr(base_chart.time, 'zm', 0) or 0))
6553+ daylight = bool(result.binding.retained_state.get('daylight', getattr(base_chart.time, 'daylightsaving', False)))
65456554 raw_return_dt = result.binding.retained_state.get('raw_return_datetime')
65466555 cycle_offset = int(result.binding.retained_state.get('cycle_offset', 0) or 0)
65476556 label = self._workspace_timed_label(mtexts.revtypeList[planet_type], result.display_datetime[0], result.display_datetime[1], result.display_datetime[2], result.display_datetime[3], result.display_datetime[4], result.display_datetime[5])
@@ -6551,7 +6560,10 @@ def _workspace_open_planetary_return_from_document(self, document_id, planet_typ
65516560 result.chart,
65526561 result.display_datetime,
65536562 result.binding,
6554- after_change=lambda active_cs: self._install_workspace_planetary_revolution_stepper(active_cs, base_chart, planet_type, place, plus, raw_return_dt, cycle_offset=cycle_offset),
6563+ after_change=lambda active_cs: self._install_workspace_planetary_revolution_stepper(
6564+ active_cs, base_chart, planet_type, place, plus, raw_return_dt,
6565+ zh=zh, zm=zm, daylight=daylight, cycle_offset=cycle_offset,
6566+ ),
65556567 )
65566568 existing_session['launcher_kind'] = 'planetary_return'
65576569 existing_session['planetary_return_type'] = int(planet_type)
@@ -6564,7 +6576,10 @@ def _workspace_open_planetary_return_from_document(self, document_id, planet_typ
65646576 radix=base_chart,
65656577 parent_document_id_override=ctx.get('parent_document_id'),
65666578 indent_level_override=(selected_indent + 1),
6567- after_open=lambda active_cs: self._install_workspace_planetary_revolution_stepper(active_cs, base_chart, planet_type, place, plus, raw_return_dt, cycle_offset=cycle_offset),
6579+ after_open=lambda active_cs: self._install_workspace_planetary_revolution_stepper(
6580+ active_cs, base_chart, planet_type, place, plus, raw_return_dt,
6581+ zh=zh, zm=zm, daylight=daylight, cycle_offset=cycle_offset,
6582+ ),
65686583 )
65696584 if doc is not None:
65706585 session = self._find_workspace_session(doc.document_id)
@@ -7305,6 +7320,31 @@ def _zone_adjusted_datetime(self, y, m, d, h, mi, s, plus, zh, zm, daylight=Fals
73057320 return (int(y), int(m), int(d), int(h), int(mi), int(s))
73067321
73077322 def _revolution_display_datetime(self, radix, y, m, d, h, mi, s, plus=None, zh=None, zm=None, daylight=None):
7323+ if radix is not None:
7324+ tzid = getattr(getattr(radix, 'time', None), 'tzid', '') or ''
7325+ zoneinfo_cls = getattr(geonames, 'ZoneInfo', None)
7326+ if not tzid and getattr(radix, 'place', None) is not None:
7327+ try:
7328+ tzid = geonames.Geonames.get_timezone_name(radix.place.lon, radix.place.lat) or ''
7329+ except Exception:
7330+ tzid = ''
7331+ if tzid and zoneinfo_cls is not None:
7332+ try:
7333+ utc_dt = datetime.datetime(
7334+ int(y), int(m), int(d), int(h), int(mi), int(s),
7335+ tzinfo=datetime.timezone.utc,
7336+ )
7337+ local_dt = utc_dt.astimezone(zoneinfo_cls(tzid))
7338+ return (
7339+ local_dt.year,
7340+ local_dt.month,
7341+ local_dt.day,
7342+ local_dt.hour,
7343+ local_dt.minute,
7344+ local_dt.second,
7345+ )
7346+ except Exception:
7347+ pass
73087348 if plus is None:
73097349 plus = getattr(radix.time, 'plus', True)
73107350 if zh is None:
@@ -7936,7 +7976,7 @@ def _reset_lr_step_state():
79367976 else:
79377977 self._rev_stepper.Show(False)
79387978
7939- def _install_workspace_planetary_revolution_stepper(self, active_cs, radix_chart, planet_type, place, plus, raw_return_dt, cycle_offset=0):
7979+ def _install_workspace_planetary_revolution_stepper(self, active_cs, radix_chart, planet_type, place, plus, raw_return_dt, zh=0, zm=0, daylight=False, cycle_offset=0):
79407980 if active_cs is None or radix_chart is None or raw_return_dt is None:
79417981 return
79427982 pid = revolutions.Revolutions.planetary_pid(planet_type)
@@ -7949,6 +7989,9 @@ def _install_workspace_planetary_revolution_stepper(self, active_cs, radix_chart
79497989 self._rev_ctx = {
79507990 'place': place,
79517991 'plus': plus,
7992+ 'zh': zh,
7993+ 'zm': zm,
7994+ 'daylight': daylight,
79527995 'revtype': chart.Chart.REVOLUTION,
79537996 'planet_type': int(planet_type),
79547997 'cycle_offset': int(cycle_offset),
@@ -7971,7 +8014,10 @@ def _apply_planet_rev(revs2):
79718014 self._planet_rev_dt = raw_dt
79728015 display_dt = self._revolution_display_datetime(
79738016 radix_chart, int(ry), int(rm), int(rd), int(rhh), int(rmi), int(rss),
7974- plus=self._rev_ctx['plus'], zh=0, zm=0, daylight=False,
8017+ plus=self._rev_ctx['plus'],
8018+ zh=self._rev_ctx.get('zh', 0),
8019+ zm=self._rev_ctx.get('zm', 0),
8020+ daylight=self._rev_ctx.get('daylight', False),
79758021 )
79768022 active_cs.change_chart(chart2, display_datetime=display_dt, change_reason='step')
79778023
@@ -8158,7 +8204,13 @@ def _open_quick_planet_revolution(self, planet_type):
81588204
81598205 time = chart.Time(t1, t2, t3, t4, t5, t6, False, radix.time.cal, chart.Time.GREENWICH, plus, 0, 0, False, place, False)
81608206 revolution = chart.Chart(radix.name, radix.male, time, place, chart.Chart.REVOLUTION, '', self.options, False)
8161- display_dt = self._revolution_display_datetime(radix, t1, t2, t3, t4, t5, t6, plus=plus, zh=0, zm=0, daylight=False)
8207+ display_dt = self._revolution_display_datetime(
8208+ radix, t1, t2, t3, t4, t5, t6,
8209+ plus=plus,
8210+ zh=getattr(radix.time, 'zh', 0),
8211+ zm=getattr(radix.time, 'zm', 0),
8212+ daylight=getattr(radix.time, 'daylightsaving', False),
8213+ )
81628214 label = self._workspace_timed_label(mtexts.revtypeList[planet_type], display_dt[0], display_dt[1], display_dt[2], display_dt[3], display_dt[4], display_dt[5])
81638215 doc = self._open_workspace_session(
81648216 revolution, session_label=label,
@@ -8168,7 +8220,14 @@ def _open_quick_planet_revolution(self, planet_type):
81688220 if doc is None:
81698221 return
81708222
8171- self._rev_ctx = {'place': place, 'plus': plus, 'revtype': chart.Chart.REVOLUTION}
8223+ self._rev_ctx = {
8224+ 'place': place,
8225+ 'plus': plus,
8226+ 'zh': getattr(radix.time, 'zh', 0),
8227+ 'zm': getattr(radix.time, 'zm', 0),
8228+ 'daylight': getattr(radix.time, 'daylightsaving', False),
8229+ 'revtype': chart.Chart.REVOLUTION,
8230+ }
81728231 self._planet_rev_dt = datetime.datetime(int(revs.t[0]), int(revs.t[1]), int(revs.t[2]), int(revs.t[3]), int(revs.t[4]), int(revs.t[5]))
81738232 try:
81748233 if hasattr(self, '_rev_stepper') and self._rev_stepper:
@@ -8197,7 +8256,10 @@ def _apply_planet_rev(revs2):
81978256 if active_cs is not None:
81988257 display_dt = self._revolution_display_datetime(
81998258 radix, int(ry), int(rm), int(rd), int(rhh), int(rmi), int(rss),
8200- plus=self._rev_ctx['plus'], zh=0, zm=0, daylight=False,
8259+ plus=self._rev_ctx['plus'],
8260+ zh=self._rev_ctx.get('zh', 0),
8261+ zm=self._rev_ctx.get('zm', 0),
8262+ daylight=self._rev_ctx.get('daylight', False),
82018263 )
82028264 active_cs.change_chart(chart2, display_datetime=display_dt, change_reason='step')
82038265
@@ -11372,14 +11434,27 @@ def onRevolutions(self, event):
1137211434 time = chart.Time(t1, t2, t3, t4, t5, t6, False, radix.time.cal, chart.Time.GREENWICH, plus, 0, 0, False, place, False)
1137311435
1137411436 revolution = chart.Chart(radix.name, radix.male, time, place, revtype, '', self.options, False)
11375- display_dt = self._revolution_display_datetime(radix, t1, t2, t3, t4, t5, t6, plus=plus, zh=0, zm=0, daylight=False)
11437+ display_dt = self._revolution_display_datetime(
11438+ radix, t1, t2, t3, t4, t5, t6,
11439+ plus=plus,
11440+ zh=getattr(radix.time, 'zh', 0),
11441+ zm=getattr(radix.time, 'zm', 0),
11442+ daylight=getattr(radix.time, 'daylightsaving', False),
11443+ )
1137611444 rev_label = self._workspace_timed_label(mtexts.typeList[revtype], display_dt[0], display_dt[1], display_dt[2], display_dt[3], display_dt[4], display_dt[5])
1137711445 self._open_workspace_session(
1137811446 revolution, session_label=rev_label,
1137911447 radix=radix, view_mode=chart_session.ChartSession.CHART,
1138011448 display_datetime=display_dt,
1138111449 )
11382- self._rev_ctx = {'place': place, 'plus': plus, 'revtype': revtype}
11450+ self._rev_ctx = {
11451+ 'place': place,
11452+ 'plus': plus,
11453+ 'zh': getattr(radix.time, 'zh', 0),
11454+ 'zm': getattr(radix.time, 'zm', 0),
11455+ 'daylight': getattr(radix.time, 'daylightsaving', False),
11456+ 'revtype': revtype,
11457+ }
1138311458
1138411459 # 이전에 떠 있던 스텝퍼가 있으면 닫기(다른 리턴일 수도 있으니 먼저 정리)
1138511460 try:
@@ -11569,7 +11644,10 @@ def _apply_planet_rev(revs2):
1156911644 if active_cs2 is not None:
1157011645 display_dt = self._revolution_display_datetime(
1157111646 radix, int(ry), int(rm), int(rd), int(rhh), int(rmi), int(rss),
11572- plus=self._rev_ctx['plus'], zh=0, zm=0, daylight=False,
11647+ plus=self._rev_ctx['plus'],
11648+ zh=self._rev_ctx.get('zh', 0),
11649+ zm=self._rev_ctx.get('zm', 0),
11650+ daylight=self._rev_ctx.get('daylight', False),
1157311651 )
1157411652 active_cs2.change_chart(
1157511653 chart2,
0 commit comments