def show_datepicker(self): ''' функция show_datepicker() открывает календарь в новом окне ''' picker = MDDatePicker(callback=self.got_date) picker.open()
def show_example_date_picker(self, *args): max_date = datetime.strptime(self.app.today_date[:10], '%d/%m/%Y').date() MDDatePicker(self.set_previous_date, max_date=max_date).open()
def show_date_picker_2(self): MDDatePicker(self.set_previous_date_2).open()
def __init__(self, products, *args, **kwargs): super().__init__(*args, **kwargs) self.title = "New Order" app = MDApp.get_running_app() self.layout = BoxLayout(size_hint_y=2) self.scroll = ScrollView() #self.scroll.do_scroll_y = True self.layout.orientation = "vertical" self.available_products = products #app.customconfig.load_products() self.product_cost = 0 self.products_selected = [] self.markup = 0.2 """ CUSTOMER NAME """ customer_layout = BoxLayout() customer_layout.add_widget(Label(text=f"Customer:")) self.customer_input = MDTextField(color_mode='accent') customer_layout.add_widget(self.customer_input) self.layout.add_widget(customer_layout) """ CUSTOMER EMAIL """ email_layout = BoxLayout() email_layout.add_widget(Label(text=f"Email:")) self.email_input = MDTextField(color_mode='accent') email_layout.add_widget(self.email_input) self.layout.add_widget(email_layout) """ PRODUCTS """ product_title_layout = BoxLayout() product_title_layout.add_widget(Label(text=f"Products: ")) self.add_prod_btn = MDRectangleFlatButton(text="Add Product") self.add_prod_menu = MDDropdownMenu( items=self.build_available_products(), width_mult=4, caller=self.add_prod_btn, callback=self.add_prod_callback) self.add_prod_btn.on_release = self.add_prod_menu.open product_title_layout.add_widget(self.add_prod_btn) self.product_list_layout = GridLayout() self.product_list_layout.cols = 3 self.layout.add_widget(product_title_layout) self.layout.add_widget(self.product_list_layout) """ MATERIAL COST """ self.Material_cost = Label(text=f"Material Cost: £0") self.layout.add_widget(self.Material_cost) """ CUSTOMER COST """ self.customer_cost = MDTextField(color_mode='accent') self.customer_cost.on_text_validate = self.validate_customer_cost cc_layout = BoxLayout() cc_layout.add_widget(Label(text="Customer Cost:")) cc_layout.add_widget(self.customer_cost) self.layout.add_widget(cc_layout) """ MARKUP """ default_markup = app.customconfig.get_setting("Markup") self.markup = MDTextField(color_mode='accent', text=str(default_markup)) self.markup.on_text_validate = self.validate_markup m_layout = BoxLayout() m_layout.add_widget(Label(text="Markup %")) m_layout.add_widget(self.markup) self.layout.add_widget(m_layout) """ ORDER DATE """ date_layout = BoxLayout() date_layout.add_widget(Label(text=f"Order Date: ")) self.picker = MDDatePicker(callback=self.date_callback) self.picker_btn = MDRectangleFlatButton(text=str(self.picker.today), on_release=self.picker.open) date_layout.add_widget(self.picker_btn) self.layout.add_widget(date_layout) """ LEAD TIME """ lead_layout = BoxLayout() lead_layout.add_widget(Label(text=f"Quoted Lead Time (Days): ")) self.leadtime_btn = MDRectangleFlatButton(text="7") self.leadtime_menu = MDDropdownMenu( items=self.build_leadTimeEntrys(app), width_mult=4, caller=self.leadtime_btn, callback=self.leadtime_callback) self.leadtime_btn.on_release = self.leadtime_menu.open lead_layout.add_widget(self.leadtime_btn) self.layout.add_widget(lead_layout) """ ORIGIN """ origin_layout = BoxLayout() origin_layout.add_widget(Label(text=f"Origin: ")) self.origin_btn = MDRectangleFlatButton(text="Facebook") self.origin_menu = MDDropdownMenu(items=self.build_originEntrys(app), width_mult=4, caller=self.origin_btn, callback=self.origin_callback) self.origin_btn.on_release = self.origin_menu.open origin_layout.add_widget(self.origin_btn) self.layout.add_widget(origin_layout) """ PAYMENT """ payment_layout = BoxLayout() payment_layout.add_widget(Label(text=f"Payment: ")) self.payment_btn = MDRectangleFlatButton(text="Unpaid") self.payment_menu = MDDropdownMenu(items=self.build_paymentEntrys(app), width_mult=4, caller=self.payment_btn, callback=self.payment_callback) self.payment_btn.on_release = self.payment_menu.open payment_layout.add_widget(self.payment_btn) self.layout.add_widget(payment_layout) """ STATUS """ status_layout = BoxLayout() status_layout.add_widget(Label(text=f"Status: ")) self.status_btn = MDRectangleFlatButton(text="Order Placed") self.status_menu = MDDropdownMenu(items=self.build_statusEntrys(app), width_mult=4, caller=self.status_btn, callback=self.status_callback) self.status_btn.on_release = self.status_menu.open status_layout.add_widget(self.status_btn) self.layout.add_widget(status_layout) """ DELIVERY """ delivery_layout = BoxLayout() delivery_layout.add_widget(Label(text="Delivery Method: ")) self.delivery_btn = MDRectangleFlatButton(text="Collection") self.delivery_menu = MDDropdownMenu( items=self.build_deliveryEntrys(app), width_mult=4, caller=self.delivery_btn, callback=self.delivery_callback) self.delivery_btn.on_release = self.delivery_menu.open delivery_layout.add_widget(self.delivery_btn) self.layout.add_widget(delivery_layout) """ SAVE | DISCARD """ buttonlayout = BoxLayout() buttonlayout.orientation = "horizontal" buttonlayout.add_widget( MDRectangleFlatButton(text="Discard", on_release=self.dismiss)) buttonlayout.add_widget( MDRectangleFlatButton(text="Save Order", on_release=self.save)) self.update_costing() self.layout.add_widget(buttonlayout) self.scroll.add_widget(self.layout) self.content = self.scroll
def _setStartDate(self, time): self._range.append(time) picker = MDDatePicker(callback=self._setEndDate, min_date=time) picker.open()
def showDatePicker(self, *args): try: MDDatePicker(self.handleDate).open() except AttributeError: MDDatePicker(self.handleDate).open()
def good(self): date_dialog = MDDatePicker(callback=lambda x: self.get_date( date_dialog.sel_day, date_dialog.sel_month, date_dialog.sel_year)) date_dialog.md_bg_color = [0.1, 0.1, 0, 1] date_dialog.open()
def date_picker(self, funct): picker = MDDatePicker(funct) picker.open()
def show_date_picker( self): #funcion con la cual se utiliza el picker de tiempo #min_date = datetime.strptime("01:10:2020", "%d:%m:%Y").date() #ax_date = datetime.strptime("01:10:2020", "%d:%m:%Y").date() date_dialog = MDDatePicker(callback=self.get_date) date_dialog.open()
def show_datepicker(self): picker = MDDatePicker() picker.bind(on_save=self.get_date) picker.open()
def abrir_popup_data_lembrete(self): primeiro_calendario = MDDatePicker(callback=self.marcar_data_lembrete) primeiro_calendario.open()
def abrir_popup_data(self): primeiro_calendario = MDDatePicker(callback=self.marcar_data_visita) primeiro_calendario.open()
def showDatePicker(self): minDate = datetime.strptime("1990:01:01", '%Y:%m:%d').date() maxDate = date.today() dateDialog = MDDatePicker(callback = self.getDate, min_date = minDate, max_date = maxDate) dateDialog.open()
def escolher_segunda_data(self, *args): self.popup_segunda_data.dismiss() segundo_calendario = MDDatePicker(callback=self.segunda_data) segundo_calendario.open()
def show_example_date_picker(self): dialog = MDDatePicker() dialog.bind(on_save=self.set_previous_date) dialog.open()
def show_date_picker(self): date_dialog = MDDatePicker(callback = self.get_date, year = 1999, month = 1, day = 1) date_dialog.open()
def show_calendar(self): MDDatePicker(self.set_previous_date).open()
def _pickFilterRange(self): self._range = [] picker = MDDatePicker(callback=self._setStartDate) picker.open()
def show_date(self): self.picker = MDDatePicker(callback=self.got_date, year=2000, month=1, day=1) self.picker.open()
def show_date_picker(self): #opens up the calender date_dialog = MDDatePicker(callback=self.got_date) date_dialog.open()
def show_datepicker(self): min_date = date.today() picker = MDDatePicker(callback=self.get_date, min_date=min_date) picker.open()
def on_select_date(self): MDDatePicker(self.set_date).open()
def show_datepicker(self, instance): MDDatePicker(callback = self.get_date).open()
def get_date(self): picker = MDDatePicker(callback=self.got_date) picker.open()
def setDate(self): import datetime dob = MDDatePicker(callback=self.get_date, min_date=datetime.datetime.now().date()) dob.open()
def show_date_picker(self): date_dialog = MDDatePicker(callback=self.got_date) date_dialog.open()
def abrir_popup_primeira_data(self): primeiro_calendario = MDDatePicker( callback=self.abrir_popup_segunda_data) primeiro_calendario.open()
def show_datepicker(self): picker = MDDatePicker(callback=self.got_date) picker.open()
def show_date_picker(self): #date_dialog = MDDatePicker(year=2000, month=2, day=14) date_dialog = MDDatePicker(mode="range") date_dialog.bind(on_save=self.on_save, on_cancel=self.on_cancel) date_dialog.open()