jbdel commited on
Commit
c3dd7a0
1 Parent(s): d29a48a

date range get options

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -449,6 +449,7 @@ with gr.Blocks(css="style.css") as demo:
449
  str: The echoed text.
450
  """
451
  calendar = gr.update(datetime.today().strftime('%Y-%m-%d'))
 
452
  conferences = gr.update(value=[])
453
  hf_options = gr.update(value=[])
454
  leaderboard_tab = gr.Tabs()
@@ -462,6 +463,9 @@ with gr.Blocks(css="style.css") as demo:
462
  if 'date' in request.query_params:
463
  calendar = gr.update(value=request.query_params['date'])
464
 
 
 
 
465
  if 'conferences' in request.query_params:
466
  conferences = request.query_params['conferences']
467
  try:
@@ -485,7 +489,7 @@ with gr.Blocks(css="style.css") as demo:
485
  if tab == "tab-leaderboards":
486
  leaderboard_tab = gr.Tabs(selected="tab-leaderboards")
487
 
488
- return calendar, conferences, hf_options, leaderboard_tab
489
 
490
 
491
  demo.load(
@@ -495,7 +499,7 @@ with gr.Blocks(css="style.css") as demo:
495
  api_name=False,
496
  ).then(
497
  fn=echo,
498
- outputs=[calendar, conference_options, hf_options, tabs]
499
  )
500
 
501
 
 
449
  str: The echoed text.
450
  """
451
  calendar = gr.update(datetime.today().strftime('%Y-%m-%d'))
452
+ date_range = gr.update(value=[])
453
  conferences = gr.update(value=[])
454
  hf_options = gr.update(value=[])
455
  leaderboard_tab = gr.Tabs()
 
463
  if 'date' in request.query_params:
464
  calendar = gr.update(value=request.query_params['date'])
465
 
466
+ if 'date_range' in request.query_params:
467
+ date_range = gr.update(value=request.query_params['date_range'])
468
+
469
  if 'conferences' in request.query_params:
470
  conferences = request.query_params['conferences']
471
  try:
 
489
  if tab == "tab-leaderboards":
490
  leaderboard_tab = gr.Tabs(selected="tab-leaderboards")
491
 
492
+ return calendar, date_range, conferences, hf_options, leaderboard_tab,
493
 
494
 
495
  demo.load(
 
499
  api_name=False,
500
  ).then(
501
  fn=echo,
502
+ outputs=[calendar, date_range_radio, conference_options, hf_options, tabs]
503
  )
504
 
505