• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022-2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_DATE_PICKER_DATE_PICKER_PATTERN_H
17 #define FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_DATE_PICKER_DATE_PICKER_PATTERN_H
18 
19 #include <optional>
20 
21 #include "core/components/common/layout/constants.h"
22 #include "core/components/picker/picker_data.h"
23 #include "core/components/picker/picker_theme.h"
24 #include "core/components_ng/base/frame_node.h"
25 #include "core/components_ng/event/event_hub.h"
26 #include "core/components_ng/pattern/linear_layout/linear_layout_pattern.h"
27 #include "core/components_ng/pattern/pattern.h"
28 #include "core/components_ng/pattern/picker/datepicker_accessibility_property.h"
29 #include "core/components_ng/pattern/picker/datepicker_column_pattern.h"
30 #include "core/components_ng/pattern/picker/datepicker_event_hub.h"
31 #include "core/components_ng/pattern/picker/datepicker_layout_property.h"
32 #include "core/components_ng/pattern/picker/datepicker_row_layout_property.h"
33 #include "core/components_ng/pattern/text/text_pattern.h"
34 #include "core/components_ng/pattern/picker/datepicker_dialog_view.h"
35 
36 namespace OHOS::Ace::NG {
37 namespace {
38 const Dimension FOCUS_PAINT_WIDTH = 2.0_vp;
39 }
40 
41 class DatePickerPattern : public LinearLayoutPattern {
42     DECLARE_ACE_TYPE(DatePickerPattern, LinearLayoutPattern);
43 
44 public:
DatePickerPattern()45     DatePickerPattern() : LinearLayoutPattern(false) {};
46 
47     ~DatePickerPattern() override = default;
48 
IsAtomicNode()49     bool IsAtomicNode() const override
50     {
51         return true;
52     }
53 
CreateEventHub()54     RefPtr<EventHub> CreateEventHub() override
55     {
56         return MakeRefPtr<DatePickerEventHub>();
57     }
58 
CreateLayoutAlgorithm()59     RefPtr<LayoutAlgorithm> CreateLayoutAlgorithm() override
60     {
61         return MakeRefPtr<LinearLayoutAlgorithm>();
62     }
63 
CreateLayoutProperty()64     RefPtr<LayoutProperty> CreateLayoutProperty() override
65     {
66         return MakeRefPtr<DataPickerRowLayoutProperty>();
67     }
68 
CreateNodePaintMethod()69     RefPtr<NodePaintMethod> CreateNodePaintMethod() override
70     {
71         auto paintMethod = MakeRefPtr<DatePickerPaintMethod>(WeakClaim(this));
72         paintMethod->SetEnabled(enabled_);
73         paintMethod->SetBackgroundColor(backgroundColor_);
74         return paintMethod;
75     }
76 
CreateAccessibilityProperty()77     RefPtr<AccessibilityProperty> CreateAccessibilityProperty() override
78     {
79         return MakeRefPtr<DatePickerAccessibilityProperty>();
80     }
81 
SetConfirmNode(WeakPtr<FrameNode> buttonConfirmNode)82     void SetConfirmNode(WeakPtr<FrameNode> buttonConfirmNode)
83     {
84         weakButtonConfirm_ = buttonConfirmNode;
85     }
86 
SetCancelNode(WeakPtr<FrameNode> buttonCancelNode)87     void SetCancelNode(WeakPtr<FrameNode> buttonCancelNode)
88     {
89         weakButtonCancel_ = buttonCancelNode;
90     }
91 
92     void OnLanguageConfigurationUpdate() override;
93 
94     void OnColorConfigurationUpdate() override;
95 
96     void SetChangeCallback(ColumnChangeCallback&& value);
97 
98     void HandleColumnChange(const RefPtr<FrameNode>& tag, bool isAdd, uint32_t index, bool needNotify);
99 
100     void SolarColumnsBuilding(const PickerDate& current);
101 
102     void LunarColumnsBuilding(const LunarDate& current);
103 
104     void SolarMonthDaysColumnsBuilding(const PickerDate& current);
105 
106     void LunarMonthDaysColumnBuilding(const LunarDate& current);
107 
108     void HandleYearChange(bool isAdd, uint32_t index, std::vector<RefPtr<FrameNode>>& resultTags);
109 
110     void HandleMonthChange(bool isAdd, uint32_t index, std::vector<RefPtr<FrameNode>>& resultTags);
111 
112     void HandleLunarMonthChange(bool isAdd, uint32_t index);
113 
114     void HandleLunarYearChange(bool isAdd, uint32_t index);
115 
116     void HandleSolarYearChange(bool isAdd, uint32_t index);
117 
118     LunarDate GetCurrentLunarDate(uint32_t lunarYear) const;
119 
120     void HandleSolarMonthChange(bool isAdd, uint32_t index);
121 
122     void HandleDayChange(bool isAdd, uint32_t index, std::vector<RefPtr<FrameNode>>& resultTags);
123 
124     void HandleReduceLunarDayChange(uint32_t index);
125 
126     void HandleLunarDayChange(bool isAdd, uint32_t index);
127 
128     void HandleAddLunarDayChange(uint32_t index);
129 
130     void HandleSolarDayChange(bool isAdd, uint32_t index);
131 
132     void HandleSolarMonthDaysChange(bool isAdd, uint32_t index);
133 
134     void HandleLunarMonthDaysChange(bool isAdd, uint32_t index);
135 
136     void HandleAddLunarMonthDaysChange(uint32_t index);
137 
138     void HandleReduceLunarMonthDaysChange(uint32_t index);
139 
140     LunarDate GetCurrentLunarDateByMonthDaysColumn(uint32_t lunarYear) const;
141 
142     PickerDate GetCurrentDate() const;
143 
144     void SetEventCallback(EventCallback&& value);
145 
146     void FireChangeEvent(bool refresh);
147 
148     void FlushColumn();
149 
150     void FlushMonthDaysColumn();
151 
152     void AdjustLunarDate(LunarDate& date);
153 
154     int LunarDateCompare(const LunarDate& left, const LunarDate& right) const;
155 
156     std::unordered_map<std::string, RefPtr<FrameNode>> GetAllChildNode();
157 
GetColumn(const int32_t & tag)158     RefPtr<FrameNode> GetColumn(const int32_t& tag) const
159     {
160         auto iter = std::find_if(datePickerColumns_.begin(), datePickerColumns_.end(), [&tag](const auto& c) {
161                 auto column = c.Upgrade();
162                 return column && column->GetId() == tag;
163             });
164         return (iter == datePickerColumns_.end()) ? nullptr : (*iter).Upgrade();
165     }
166 
SetColumn(const RefPtr<FrameNode> & value)167     void SetColumn(const RefPtr<FrameNode>& value)
168     {
169         datePickerColumns_.emplace_back(value);
170     }
171 
ClearColumn()172     void ClearColumn()
173     {
174         datePickerColumns_.clear();
175     }
176 
SetShowLunar(bool value)177     void SetShowLunar(bool value)
178     {
179         isForceUpdate_ = true;
180         lunar_ = value;
181     }
182 
IsShowLunar()183     bool IsShowLunar() const
184     {
185         return lunar_;
186     }
187 
SetShowMonthDaysFlag(bool value)188     void SetShowMonthDaysFlag(bool value)
189     {
190         showMonthDays_ = value;
191     }
192 
ShowMonthDays()193     bool ShowMonthDays() const
194     {
195         return showMonthDays_;
196     }
197 
SetShowTimeFlag(bool value)198     void SetShowTimeFlag(bool value)
199     {
200         showTime_ = value;
201     }
202 
GetDialogAcceptEvent()203     const EventMarker& GetDialogAcceptEvent() const
204     {
205         return OnDialogAccept_;
206     }
SetDialogAcceptEvent(const EventMarker & value)207     void SetDialogAcceptEvent(const EventMarker& value)
208     {
209         OnDialogAccept_ = value;
210     }
211 
GetDialogCancelEvent()212     const EventMarker& GetDialogCancelEvent() const
213     {
214         return OnDialogCancel_;
215     }
SetDialogCancelEvent(const EventMarker & value)216     void SetDialogCancelEvent(const EventMarker& value)
217     {
218         OnDialogCancel_ = value;
219     }
220 
GetDialogChangeEvent()221     const EventMarker& GetDialogChangeEvent() const
222     {
223         return OnDialogChange_;
224     }
SetDialogChangeEvent(const EventMarker & value)225     void SetDialogChangeEvent(const EventMarker& value)
226     {
227         OnDialogChange_ = value;
228     }
229 
SetResizePickerItemHeight(double resizePickerItemHeight)230     void SetResizePickerItemHeight(double resizePickerItemHeight)
231     {
232         resizePickerItemHeight_ = resizePickerItemHeight;
233     }
234 
GetResizePickerItemHeight()235     double GetResizePickerItemHeight() const
236     {
237         return resizePickerItemHeight_;
238     }
239 
SetResizeFlag(bool resizeFlag)240     void SetResizeFlag(bool resizeFlag)
241     {
242         resizeFlag_ = resizeFlag;
243     }
244 
GetResizeFlag()245     bool GetResizeFlag() const
246     {
247         return resizeFlag_;
248     }
249 
SetIsShowInDialog(bool isShowInDialog)250     void SetIsShowInDialog(bool isShowInDialog)
251     {
252         isShowInDialog_ = isShowInDialog;
253     }
254 
GetIsShowInDialog()255     bool GetIsShowInDialog() const
256     {
257         return isShowInDialog_;
258     }
259 
GetOptionCount(RefPtr<FrameNode> & frmeNode)260     uint32_t GetOptionCount(RefPtr<FrameNode>& frmeNode)
261     {
262         return options_[frmeNode].size();
263     }
264 
GetOptionValue(RefPtr<FrameNode> & frmeNode,uint32_t index)265     PickerDateF GetOptionValue(RefPtr<FrameNode>& frmeNode, uint32_t index)
266     {
267         if (index >= GetOptionCount(frmeNode)) {
268             LOGE("index out of range.");
269             return {};
270         }
271         return options_[frmeNode][index];
272     }
273 
GetAllOptions(RefPtr<FrameNode> & frmeNode)274     const std::vector<PickerDateF>& GetAllOptions(RefPtr<FrameNode>& frmeNode)
275     {
276         return options_[frmeNode];
277     }
278 
GetOptions()279     const std::map<WeakPtr<FrameNode>, std::vector<PickerDateF>>& GetOptions() const
280     {
281         return options_;
282     }
283 
GetShowCount()284     uint32_t GetShowCount() const
285     {
286         return showCount_;
287     }
288 
SetShowCount(uint32_t showCount)289     void SetShowCount(uint32_t showCount)
290     {
291         showCount_ = showCount;
292     }
293 
GetYearFormatString(uint32_t year)294     static std::string GetYearFormatString(uint32_t year)
295     {
296         return PickerStringFormatter::GetYear(year);
297     }
298 
GetMonthFormatString(uint32_t month,bool isLunar,bool isLeap)299     static std::string GetMonthFormatString(uint32_t month, bool isLunar, bool isLeap)
300     {
301         if (isLunar) {
302             return PickerStringFormatter::GetLunarMonth(month, isLeap);
303         }
304         return PickerStringFormatter::GetSolarMonth(month);
305     }
306 
GetDayFormatString(uint32_t day,bool isLunar)307     static std::string GetDayFormatString(uint32_t day, bool isLunar)
308     {
309         if (isLunar) {
310             return PickerStringFormatter::GetLunarDay(day);
311         }
312         return PickerStringFormatter::GetSolarDay(day);
313     }
314 
315     uint32_t GetLunarMaxDay(uint32_t year, uint32_t month, bool isLeap) const;
316 
317     bool GetLunarLeapMonth(uint32_t year, uint32_t& outLeapMonth) const;
318 
319     LunarDate SolarToLunar(const PickerDate& date) const;
320 
321     PickerDate LunarToSolar(const LunarDate& date) const;
322 
323     void UpdateCurrentOffset(float offset);
324 
325     void OnDataLinking(
326         const RefPtr<FrameNode>& tag, bool isAdd, uint32_t index, std::vector<RefPtr<FrameNode>>& resultTags);
327 
328     void HandleMonthDaysChange(
329         const RefPtr<FrameNode>& tag, bool isAdd, uint32_t index, std::vector<RefPtr<FrameNode>>& resultTags);
330 
331     std::string GetSelectedObject(bool isColumnChange, int status = -1) const;
332 
GetSelectDate()333     const LunarDate& GetSelectDate()
334     {
335         return selectedLunar_;
336     }
337 
SetSelectDate(const PickerDate & value)338     void SetSelectDate(const PickerDate& value)
339     {
340         selectedDate_ = value;
341         isFiredDateChange_ = firedDateStr_.has_value() && firedDateStr_.value() == GetSelectedObject(false);
342         firedDateStr_.reset();
343         if (selectedDate_.GetYear() <= 0) {
344             LOGW("selectedDate error");
345             selectedDate_ = PickerDate::Current();
346         }
347         AdjustSolarDate(selectedDate_, startDateSolar_, endDateSolar_);
348         selectedLunar_ = SolarToLunar(selectedDate_);
349     }
350 
GetSelectedDate()351     const PickerDate& GetSelectedDate()
352     {
353         return selectedDate_;
354     }
355 
SetStartDate(const PickerDate & value)356     void SetStartDate(const PickerDate& value)
357     {
358         startDateSolar_ = value;
359         AdjustSolarDate(startDateSolar_, limitStartDate_, limitEndDate_);
360         startDateLunar_ = SolarToLunar(startDateSolar_);
361     }
362 
GetStartDateLunar()363     const LunarDate& GetStartDateLunar()
364     {
365         return startDateLunar_;
366     }
367 
SetEndDate(const PickerDate & value)368     void SetEndDate(const PickerDate& value)
369     {
370         endDateSolar_ = value;
371         AdjustSolarDate(endDateSolar_, limitStartDate_, limitEndDate_);
372         endDateLunar_ = SolarToLunar(endDateSolar_);
373     }
374 
GetEndDateLunar()375     const LunarDate& GetEndDateLunar()
376     {
377         return endDateLunar_;
378     }
379 
AdjustSolarDate(PickerDate & date,const PickerDate & start,const PickerDate & end)380     void AdjustSolarDate(PickerDate& date, const PickerDate& start, const PickerDate& end) const
381     {
382         if (SolarDateCompare(date, start) < 0) {
383             date = start;
384             return;
385         }
386         if (SolarDateCompare(date, end) > 0) {
387             date = end;
388         }
389     }
390 
AdjustSolarDate(PickerDate & date)391     void AdjustSolarDate(PickerDate& date) const
392     {
393         AdjustSolarDate(date, startDateSolar_, endDateSolar_);
394     }
395 
SolarDateCompare(const PickerDate & left,const PickerDate & right)396     static int SolarDateCompare(const PickerDate& left, const PickerDate& right)
397     {
398         static const int leftEqualRight = 0; // means left = right
399         static const int leftGreatRight = 1; // means left > right
400         static const int leftLessRight = -1; // means left < right
401         if (left.GetYear() > right.GetYear()) {
402             return leftGreatRight;
403         }
404         if (left.GetYear() < right.GetYear()) {
405             return leftLessRight;
406         }
407         if (left.GetMonth() > right.GetMonth()) {
408             return leftGreatRight;
409         }
410         if (left.GetMonth() < right.GetMonth()) {
411             return leftLessRight;
412         }
413         if (left.GetDay() > right.GetDay()) {
414             return leftGreatRight;
415         }
416         if (left.GetDay() < right.GetDay()) {
417             return leftLessRight;
418         }
419         return leftEqualRight;
420     }
421 
HasYearNode()422     bool HasYearNode() const
423     {
424         return yearId_.has_value();
425     }
426 
GetYearId()427     int32_t GetYearId()
428     {
429         if (!yearId_.has_value()) {
430             yearId_ = ElementRegister::GetInstance()->MakeUniqueId();
431         }
432         return yearId_.value();
433     }
434 
HasMonthNode()435     bool HasMonthNode() const
436     {
437         return monthId_.has_value();
438     }
439 
GetMonthId()440     int32_t GetMonthId()
441     {
442         if (!monthId_.has_value()) {
443             monthId_ = ElementRegister::GetInstance()->MakeUniqueId();
444         }
445         return monthId_.value();
446     }
447 
HasDayNode()448     bool HasDayNode() const
449     {
450         return dayId_.has_value();
451     }
452 
GetDayId()453     int32_t GetDayId()
454     {
455         if (!dayId_.has_value()) {
456             dayId_ = ElementRegister::GetInstance()->MakeUniqueId();
457         }
458         return dayId_.value();
459     }
460 
HasMonthDaysNode()461     bool HasMonthDaysNode() const
462     {
463         return monthDaysId_.has_value();
464     }
465 
GetMonthDaysId()466     int32_t GetMonthDaysId()
467     {
468         if (!monthDaysId_.has_value()) {
469             monthDaysId_ = ElementRegister::GetInstance()->MakeUniqueId();
470         }
471         return monthDaysId_.value();
472     }
473 
HasTitleNode()474     bool HasTitleNode() const
475     {
476         return titleId_.has_value();
477     }
478 
SetTitleId(const int32_t id)479     bool SetTitleId(const int32_t id)
480     {
481         if (HasTitleNode()) {
482             return false;
483         }
484         titleId_ = id;
485         return true;
486     }
487 
GetTitleId()488     int32_t GetTitleId()
489     {
490         if (!titleId_.has_value()) {
491             titleId_ = ElementRegister::GetInstance()->MakeUniqueId();
492         }
493         return titleId_.value();
494     }
495 
HasButtonTitleNode()496     bool HasButtonTitleNode() const
497     {
498         return ButtonTitleId_.has_value();
499     }
500 
GetButtonTitleId()501     int32_t GetButtonTitleId()
502     {
503         if (!ButtonTitleId_.has_value()) {
504             ButtonTitleId_ = ElementRegister::GetInstance()->MakeUniqueId();
505         }
506         return ButtonTitleId_.value();
507     }
508 
HasDividerNode()509     bool HasDividerNode() const
510     {
511         return DividerId_.has_value();
512     }
513 
GetDividerId()514     int32_t GetDividerId()
515     {
516         if (!DividerId_.has_value()) {
517             DividerId_ = ElementRegister::GetInstance()->MakeUniqueId();
518         }
519         return DividerId_.value();
520     }
521 
SetBackgroundColor(const Color & color)522     void SetBackgroundColor(const Color& color)
523     {
524         backgroundColor_ = color;
525     }
526 
527     static const std::string& GetYear(uint32_t year);
528 
529     static const std::string& GetSolarMonth(uint32_t month);
530 
531     static const std::string& GetSolarDay(uint32_t day);
532 
533     static const std::string& GetLunarMonth(uint32_t month, bool isLeap);
534 
535     static const std::string& GetLunarDay(uint32_t day);
536 
GetFocusPattern()537     FocusPattern GetFocusPattern() const override
538     {
539         auto pipeline = PipelineBase::GetCurrentContext();
540         CHECK_NULL_RETURN(pipeline, FocusPattern());
541         auto pickerTheme = pipeline->GetTheme<PickerTheme>();
542         CHECK_NULL_RETURN(pickerTheme, FocusPattern());
543         auto focusColor = pickerTheme->GetFocusColor();
544         FocusPaintParam focusPaintParams;
545         focusPaintParams.SetPaintColor(focusColor);
546         focusPaintParams.SetPaintWidth(FOCUS_PAINT_WIDTH);
547         return { FocusType::NODE, true, FocusStyleType::CUSTOM_REGION, focusPaintParams };
548     }
549 
550     void ShowTitle(int32_t titleId);
551     void ToJsonValue(std::unique_ptr<JsonValue>& json) const override;
SetContentRowNode(RefPtr<FrameNode> & contentRowNode)552     void SetContentRowNode(RefPtr<FrameNode>& contentRowNode)
553     {
554         contentRowNode_ = contentRowNode;
555     }
SetbuttonTitleNode(RefPtr<FrameNode> & buttonTitleNode)556     void SetbuttonTitleNode(RefPtr<FrameNode>& buttonTitleNode)
557     {
558         buttonTitleNode_ = buttonTitleNode;
559     }
560 
SetPickerTag(bool isPicker)561     void SetPickerTag(bool isPicker)
562     {
563         isPicker_ = isPicker;
564     }
565 
566     void SetFocusDisable();
567     void SetFocusEnable();
568     static const std::string GetFormatString(PickerDateF data);
569 
570 private:
571     void OnModifyDone() override;
572     void OnAttachToFrameNode() override;
573     bool OnDirtyLayoutWrapperSwap(const RefPtr<LayoutWrapper>& dirty, const DirtySwapConfig& config) override;
574     static void Init();
575     void InitDisabled();
576     void GetInnerFocusPaintRect(RoundRect& paintRect);
577     void PaintFocusState();
578     void InitOnKeyEvent(const RefPtr<FocusHub>& focusHub);
579     bool OnKeyEvent(const KeyEvent& event);
580     bool HandleDirectionKey(KeyCode code);
581     PickerDate GetCurrentDateByMonthDaysColumn() const;
582     PickerDate GetCurrentDateByYearMonthDayColumn() const;
583     void FillSolarYearOptions(const PickerDate& current, RefPtr<FrameNode>& yearColumn);
584     void FillLunarMonthDaysOptions(const LunarDate& current, RefPtr<FrameNode>& monthDaysColumn);
585     void AdjustSolarStartEndDate();
586     void AdjustLunarStartEndDate();
587     RefPtr<ClickEvent> clickEventListener_;
588     bool enabled_ = true;
589     int32_t focusKeyID_ = 0;
590     std::map<WeakPtr<FrameNode>, std::vector<PickerDateF>> options_;
591     uint32_t showCount_ = 0;
592     std::vector<WeakPtr<FrameNode>> datePickerColumns_;
593     bool lunar_ = false;
594     bool showMonthDays_ = false;
595     bool showTime_ = false;
596     Color backgroundColor_ = Color::WHITE;
597     std::optional<int32_t> yearId_;
598     std::optional<int32_t> monthId_;
599     std::optional<int32_t> dayId_;
600     std::optional<int32_t> monthDaysId_;
601     std::optional<int32_t> dateNodeId_;
602     std::optional<int32_t> titleId_;
603     std::optional<int32_t> ButtonTitleId_;
604     std::optional<int32_t> DividerId_;
605     double resizePickerItemHeight_;
606     bool resizeFlag_ = false;
607     bool isShowInDialog_ = false;
608     EventMarker OnDialogAccept_;
609     EventMarker OnDialogCancel_;
610     EventMarker OnDialogChange_;
611     WeakPtr<FrameNode> weakButtonConfirm_;
612     WeakPtr<FrameNode> weakButtonCancel_;
613     PickerDate startDateSolar_ = PickerDate(1970, 1, 1); // default start date is 1970-1-1 from FA document.
614     LunarDate startDateLunar_;
615     PickerDate endDateSolar_ = PickerDate(2100, 12, 31); // default end date is 2100-12-31 from FA document.
616     LunarDate endDateLunar_;
617     PickerDate selectedDate_ = PickerDate::Current();
618     LunarDate selectedLunar_;
619     PickerDate startDefaultDateSolar_ = PickerDate(1970, 1, 1); // default start date is 1970-1-1 from FA document.
620     PickerDate endDefaultDateSolar_ = PickerDate(2100, 12, 31); // default end date is 2100-12-31 from FA document.
621     const PickerDate limitStartDate_ = PickerDate(1900, 1, 31);
622     const PickerDate limitEndDate_ = PickerDate(2100, 12, 31);
623     static bool inited_;
624     static const std::string empty_;
625     static const PickerDateF emptyPickerDate_;
626     static std::unordered_map<uint32_t, std::string> years_;       // year from 1900 to 2100,count is 201
627     static std::unordered_map<uint32_t, std::string> solarMonths_; // solar month from 1 to 12,count is 12
628     static std::unordered_map<uint32_t, std::string> solarDays_;   // solar day from 1 to 31, count is 31
629     static std::unordered_map<uint32_t, std::string> lunarMonths_; // lunar month from 1 to 24, count is 24
630     static std::unordered_map<uint32_t, std::string> lunarDays_;   // lunar day from 1 to 30, count is 30
631     static std::vector<std::string> tagOrder_;    // year month day tag order
632     static std::vector<std::string> localizedMonths_;
633     WeakPtr<FrameNode> contentRowNode_;
634     WeakPtr<FrameNode> buttonTitleNode_;
635     bool isPicker_ = false;
636     bool isFiredDateChange_ = false;
637     bool isForceUpdate_ = false;
638     std::optional<std::string> firedDateStr_;
639     ACE_DISALLOW_COPY_AND_MOVE(DatePickerPattern);
640 };
641 } // namespace OHOS::Ace::NG
642 
643 #endif // FOUNDATION_ACE_FRAMEWORKS_CORE_COMPONENTS_NG_PATTERNS_DATE_PICKER_DATE_PICKER_PATTERN_H
644