How to remove time from date in PySimpleGUI

Viewed 2443

I do not wish to have the time recorded in either the input box nor the db. I am new to PySimpleGUI, this is my first app using it actually.

import PySimpleGUI as sg
import datetime

main_name_list =  ['Joe',
             'Billy',
             'Jerry',
             'Tommy',
             'Bobby',
             'Oscar']


main_reason_list = ['Vacation',
             'Training',
             'Work Travel',
             'FMLA',
             'Development',
             'Other']
name = main_name_list
reason = main_reason_list

# Stuff inside window
layout = [
    [sg.Text('Scheduler')], 
    [sg.Combo(name, size=(30,4), enable_events=True)],
    [sg.Combo(reason, size=(30,4), enable_events=True)],
    [sg.T('Start Date')],
          [sg.In('', size=(20,1), key='input1')],
          [sg.CalendarButton('Choose Start Date', target='input1', key='date1')],
    [sg.T('End Date')],
          [sg.In('', size=(20,1), key='input2')],
          [sg.CalendarButton('Choose End Date', target='input2', key='date2')],
    [sg.Button('Submit'), sg.Button('Exit')]]

# create the window
window = sg.Window('Scheduler',grab_anywhere=False).Layout(layout)
# event loop to process events and get the values of inputs
while True:      
    event, values = window.Read() 
    print(event, values)       
    if event in (None, 'Exit'):      
        break  

window.Close()

I continue to get the time associated with the date.

1 Answers
Related