# Path: hamster_gtk/helpers.py
# def _u(string):
# def show_error(parent, error, message=None):
# def clear_children(widget):
# def get_parent_window(widget):
# def calendar_date_to_datetime(date):
# def decompose_raw_fact_string(text, raw=False):
# def get_delta_string(delta):
# def rgb_to_gtk_rgb(r, g, b):


import calendar
import datetime
from gettext import gettext as _
from gi.repository import Gtk
from hamster_gtk import helpers
        Initialize widget.

        Args:
            parent (OverviewScreen): Parent window for this dialog.
        """
        super(DateRangeSelectDialog, self).__init__(*args, **kwargs)
        self.set_transient_for(parent)
        self._mainbox = Gtk.Grid()
        self._mainbox.set_hexpand(True)
        self._mainbox.set_vexpand(True)

        self._start_calendar = Gtk.Calendar()
        self._end_calendar = Gtk.Calendar()

        self._mainbox.attach(self._get_today_widget(), 0, 0, 4, 1)
        self._mainbox.attach(self._get_week_widget(), 0, 1, 4, 1)
        self._mainbox.attach(self._get_month_widget(), 0, 2, 4, 1)
        self._mainbox.attach(self._get_custom_range_label(), 0, 3, 1, 1)
        self._mainbox.attach(self._get_custom_range_connection_label(), 2, 3, 1, 1)
        self._mainbox.attach(self._start_calendar, 1, 3, 1, 1)
        self._mainbox.attach(self._end_calendar, 3, 3, 1, 1)

        self.get_content_area().add(self._mainbox)
        self.add_action_widget(self._get_apply_button(), Gtk.ResponseType.APPLY)
        self.show_all()

    @property
    def daterange(self):
        """Return start and end date as per calendar widgets."""
        start = helpers.calendar_date_to_datetime(self._start_calendar.get_date())

# Path: hamster_gtk/helpers.py
# def _u(string):
# def show_error(parent, error, message=None):
# def clear_children(widget):
# def get_parent_window(widget):
# def calendar_date_to_datetime(date):
# def decompose_raw_fact_string(text, raw=False):
# def get_delta_string(delta):
# def rgb_to_gtk_rgb(r, g, b):


# Path: hamster_gtk/misc/dialogs/date_range_select_dialog.py
import calendar
import datetime
from gettext import gettext as _
from gi.repository import Gtk
from hamster_gtk import helpers

        Initialize widget.

        Args:
            parent (OverviewScreen): Parent window for this dialog.
        """
        super(DateRangeSelectDialog, self).__init__(*args, **kwargs)
        self.set_transient_for(parent)
        self._mainbox = Gtk.Grid()
        self._mainbox.set_hexpand(True)
        self._mainbox.set_vexpand(True)

        self._start_calendar = Gtk.Calendar()
        self._end_calendar = Gtk.Calendar()

        self._mainbox.attach(self._get_today_widget(), 0, 0, 4, 1)
        self._mainbox.attach(self._get_week_widget(), 0, 1, 4, 1)
        self._mainbox.attach(self._get_month_widget(), 0, 2, 4, 1)
        self._mainbox.attach(self._get_custom_range_label(), 0, 3, 1, 1)
        self._mainbox.attach(self._get_custom_range_connection_label(), 2, 3, 1, 1)
        self._mainbox.attach(self._start_calendar, 1, 3, 1, 1)
        self._mainbox.attach(self._end_calendar, 3, 3, 1, 1)

        self.get_content_area().add(self._mainbox)
        self.add_action_widget(self._get_apply_button(), Gtk.ResponseType.APPLY)
        self.show_all()

    @property
    def daterange(self):
        """Return start and end date as per calendar widgets."""
        start = helpers.calendar_date_to_datetime(self._start_calendar.get_date())

        end = helpers.calendar_date_to_datetime(self._end_calendar.get_date())