Babel cannot parse its own format?
See original GitHub issueimport babel.dates
import datetime
today = datetime.datetime.today()
formatted = babel.dates.format_date(today, locale='hu')
print(repr(formatted))
'2017. nov. 11.'
babel.dates.parse_date(formatted)
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Users\User\AppData\Local\Programs\Python\Python34-32\lib\site-packages\babel\dates.py", line 1144, in parse_date
format = get_date_format(locale=locale).pattern.lower()
File "C:\Users\User\AppData\Local\Programs\Python\Python34-32\lib\site-packages\babel\dates.py", line 378, in get_date_format
return Locale.parse(locale).date_formats[format]
AttributeError: 'NoneType' object has no attribute 'date_formats'
babel.dates.parse_date(formatted, locale='hu')
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Users\User\AppData\Local\Programs\Python\Python34-32\lib\site-packages\babel\dates.py", line 1165, in parse_date
day = int(numbers[indexes['D']])
IndexError: list index out of range
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
babel/parser
The Babel parser (previously Babylon) is a JavaScript parser used in Babel. The latest ECMAScript version enabled by default (ES2020). Comment attachment.
Read more >Stop babel parse and generate reformatting output code
I need to do this while retaining the javascript's formatting but it's re-formatting it. I can't see anything else in the options for...
Read more >How to Bundle JavaScript With Rollup — Step-by-Step Tutorial
Learn how to use Rollup as a smaller, more efficient alternative to webpack and Browserify to bundle JavaScript files in this step-by-step tutorial...
Read more >Babel Documentation - Read the Docs
Remember to test your code to make sure it behaves as desired. 1.5.3 Parsing Numbers. Babel can also parse numeric data in a...
Read more >rollup.js
It uses the new standardized format for code modules included in the ES6 ... Imported values cannot be reassigned, though imported objects and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I just tested dateparser and well, it cannot be beaten. 🥇 I can do things like converting “today” or “one month ago” or even “két héttel ezelőtt” (meaning: “two weeks ago”). All of them are converted to the correct date and time. This is truly amazing!
@cbirger Same issue with me running Pycharm on my dev win10 machine, wonder if its on babel’s side or my os’s