ampil opened a new issue, #31790:
URL: https://github.com/apache/superset/issues/31790

   ### Bug description
   
   The new [PR](https://github.com/apache/superset/pull/24263) introduced 
custom D3 datetime formatting. 
   
   However, it works partially - when datetime format is forced to `%b`, `%B` 
for example.
   When the datetime is set to `Adaptive`, the custom datetime format ignored 
reverting back month names to English.
   
   
   How to reproduce the bug:
   Add a custom D3 Time format to `superset_config.py`:
   ```
   D3_TIME_FORMAT = {
     "dateTime": "%d.%m.%Y %H:%M:%S",
     "date": "%d.%m.%Y",
     "time": "%H:%M:%S",
     "periods": ["AM", "PM"],
     "days": ["Понедельник", "Вторник", "Среда", "Четверг", "Пятница", 
"Суббота", "Воскресенье"],
     "shortDays": ["Пон", "Вт", "Ср", "Чт", "Пт", "Сб", "Вс"],
     "months": ["Январь", "Февраль", "Март", "Апрель", "Май", "Июнь", "Июль", 
"Август", "Сентябрь", "Октябрь", "Ноябрь", "Декабрь"],
     "shortMonths": ["Янв", "Фев", "Мар", "Апр", "Май", "Июн", "Июл", "Авг", 
"Сен", "Окт", "Ноя", "Дек"]
   }
   ```
   
   Create a virtual dataset with some data (PostgreSQL syntax):
   ```
   select startdate::date as startdate
         , floor(random() * 100) + 1 AS random_integer
   from generate_series('2024-05-25', now(), '1 day'::interval) as startdate  
   order by startdate desc;
   ```
   
   Create a line chart with `start_date` on the X-axis, `random_integer` on the 
Y-axis:
   
![image](https://github.com/user-attachments/assets/d87ede42-16d8-4333-aebe-b4e2fa56211f)
   
   Change X-axis datetime format to `%B`, note the changes:
   
![image](https://github.com/user-attachments/assets/454115e2-76a1-4da0-accf-1961d59195cc)
   
   
   
   
   ### Screenshots/recordings
   
   Another example related to the same behaviour:
   
   The custom D3 datetime format shows up when a certain datetime format 
applied, for example `%B`:
   
![image](https://github.com/user-attachments/assets/8fbe30ff-7654-41d3-b5d2-26dd7cb517ec)
   
![image](https://github.com/user-attachments/assets/c8f5996f-4d7a-4685-9d32-5b5f0cda4bea)
   
   But in case an `adaptive` formatting applied on the X axis, the E3 
formatting is reverting back to defaults (English):
   
![image](https://github.com/user-attachments/assets/f778374d-abb4-426d-b5f7-2abd48a3538f)
   
![image](https://github.com/user-attachments/assets/a7bb6c75-f345-4c06-b313-99db5a515dad)
   
   
   ### Superset version
   
   4.1.1
   
   ### Python version
   
   3.9
   
   ### Node version
   
   16
   
   ### Browser
   
   Chrome
   
   ### Additional context
   
   _No response_
   
   ### Checklist
   
   - [X] I have searched Superset docs and Slack and didn't find a solution to 
my problem.
   - [X] I have searched the GitHub issue tracker and didn't find a similar bug 
report.
   - [X] I have checked Superset's logs for errors and if I found a relevant 
Python stacktrace, I included it here as text in the "additional context" 
section.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to