Repository: apache/airflow

Issue:
Task modal links are broken in the dag gantt view
### Apache Airflow version

2.2.0 (latest released)

### Operating System

Debian GNU/Linux 11 (bullseye)

### Versions of Apache Airflow Providers

N/A

### Deployment

Other Docker-based deployment

### Deployment details

CeleryExecutor / ECS / Postgres

### What happened

![image](https://user-images.githubusercontent.com/160865/139075540-25fca98f-a858-49ce-8f3f-1b9a145a6853.png)

Clicking on logs / instance details on the following dialog causes an exception:

```
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.9/site-packages/flask/_compat.py", line 39, in reraise
    raise value
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1950, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1936, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/usr/local/lib/python3.9/site-packages/airflow/www/auth.py", line 51, in decorated
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/airflow/www/decorators.py", line 63, in wrapper
    log.execution_date = pendulum.parse(execution_date_value, strict=False)
  File "/usr/local/lib/python3.9/site-packages/pendulum/parser.py", line 29, in parse
    return _parse(text, **options)
  File "/usr/local/lib/python3.9/site-packages/pendulum/parser.py", line 45, in _parse
    parsed = base_parse(text, **options)
  File "/usr/local/lib/python3.9/site-packages/pendulum/parsing/__init__.py", line 74, in parse
    return _normalize(_parse(text, **_options), **_options)
  File "/usr/local/lib/python3.9/site-packages/pendulum/parsing/__init__.py", line 120, in _parse
    return _parse_common(text, **options)
  File "/usr/local/lib/python3.9/site-packages/pendulum/parsing/__init__.py", line 177, in _parse_common
    return date(year, month, day)
ValueError: year 0 is out of range
```
This is because the execution_date in the query param of the url is empty i.e:

`http://localhost:50008/log?dag_id=test_logging&task_id=check_exception_to_sentry&execution_date=`

### What you expected to happen

The logs to load / task instance detail page to load

### How to reproduce

See above

### Anything else

_No response_

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)



Discussion:

Resolving patch:
diff --git a/airflow/www/views.py b/airflow/www/views.py
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -2863,6 +2863,7 @@ def gantt(self, session=None):
             task_dict['end_date'] = task_dict['end_date'] or timezone.utcnow()
             task_dict['extraLinks'] = dag.get_task(ti.task_id).extra_links
             task_dict['try_number'] = try_count
+            task_dict['execution_date'] = dttm
             tasks.append(task_dict)
 
         tf_count = 0
@@ -2884,6 +2885,7 @@ def gantt(self, session=None):
             task_dict['operator'] = task.task_type
             task_dict['try_number'] = try_count
             task_dict['extraLinks'] = task.extra_links
+            task_dict['execution_date'] = dttm
             tasks.append(task_dict)
 
         task_names = [ti.task_id for ti in tis]


Test patch: