# Django-admin error for DateTimeField()

**URL:** <https://forum.djangoproject.com/t/django-admin-error-for-datetimefield/10606>\
**Category:** Using Django\
**Created:** [November 21, 2021, 4:09pm UTC](https://forum.djangoproject.com/t/django-admin-error-for-datetimefield/10606 "2021-11-21T16:09:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tnmy2426](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/tnmy2426/32/6430_2.png) [@tnmy2426](https://forum.djangoproject.com/u/tnmy2426)\
**Post date:** [November 21, 2021, 4:09pm UTC](https://forum.djangoproject.com/t/django-admin-error-for-datetimefield/10606/1 "2021-11-21T16:09:25Z")

</div>

I worked with Django DateTimeFiled() before. Recently, I got a problem which is, DateTimeFiled() widgets on django-admin-site not working. and it’s returning an error on the console which is saying :

> Uncaught TypeError: Cannot read properties of undefined (reading ‘10’)  
> at Date.getAbbrevMonthName (core.js:91)  
> at Date.strftime (core.js:102)  
> at Object.handleCalendarQuickLink (DateTimeShortcuts.js:415)  
> at HTMLAnchorElement. (DateTimeShortcuts.js:248)

I was working on that project for more than 1 month. It was okay before. Never saw that error. But suddenly I got this issue on my project and I’m stuck 😭  
Searched and tried to solve that issue. But I didn’t find anything related.  
If anyone can help on this matter it would be great.  
Thanks in Advance.

---

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [November 21, 2021, 5:27pm UTC](https://forum.djangoproject.com/t/django-admin-error-for-datetimefield/10606/2 "2021-11-21T17:27:07Z")

</div>

Based on only the information provided here, I’d suggest you work your way backward through your source code repository history until you find a version that worked, and compare that to the first version that doesn’t work in order to identify the cause of the problem.

Beyond that, we’d need to start with seeing your ModelAdmin class for this model, possibly the Model class, and anything else you might have customized in the admin associated with this. (Any custom JavaScript, etc)

---

<div class="post-metadata">

**Author:** ![tnmy2426](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/tnmy2426/32/6430_2.png) [@tnmy2426](https://forum.djangoproject.com/u/tnmy2426)\
**Post date:** [November 22, 2021, 1:21pm UTC](https://forum.djangoproject.com/t/django-admin-error-for-datetimefield/10606/3 "2021-11-22T13:21:44Z")

</div>

Actually, I’ve already tried that. I’ve downloaded the last committed codes from my GitHub repository(When it was working fine). Then after migrating everything with a new database it shows the same error on my admin site.  
It’s a javascript error that was showing in my console.  
In my database model, I had a **DateTim** e field. After migrating I should have a **DateTime input filed** in django-admin-site. That input field works fine if I manually input date or time. But besides that input field, we have **2 widgets** for **date** and **2 widgets** for **time** which are called ‘now’ ‘calender-icon’ & ‘now’ ‘clock-icon’. Those **4 widgets** are not working, after clicking on those widgets this error occurs otherwise application working fine.  
Now the point is, those 4 widgets were provided by django itself. And those ‘core.js’, ‘DateTimeShortcuts.js’ files were also provided by django itself.  
Actually, I don’t even know how to get those admin related files (CSS,js etc) in my project directory ☹

So, I didn’t change any js related to admin. I did write or add an `<script> captcha </script>` in my base.html at the bottom for Captcha(JS). And when I did that, there was no error in my application not even in my admin-site.
