Questions tagged [datefield]
307 questions
2
votes
1 answer
ExtJS strange dateTimeField value in POST
I am using ExtJS version 3.0.0 and I really don't know why every time I submit a form with a datefield, the date is send to POST like this: Y-7-31 0:i:0 . I have not extended/modified the datefield code, anybody else encountered this problem ?
EDIT:…

Manny Calavera
- 6,815
- 20
- 60
- 85
2
votes
2 answers
Django DateField: enter a date without a year to mean this year
I want to allow the entry of a date without a year into a DateField to mean the actual year. Like "10.6." should mean 10 June 2021, since it's 2021 at the time of writing. The following DATE_INPUT_FORMATS didn't cut it:
DATE_INPUT_FORMATS =…

cxxl
- 4,939
- 3
- 31
- 52
2
votes
2 answers
How to make the format of a DateField to dd/mm/yyyy?
There is a DateField in my Form and I want the field value to be displayed in the format dd/mm/yyyy after dismissing ( choosing ) a date from the date-popup. How to achieve that ?
user833129
2
votes
1 answer
comparing DateField with timezone.now().date()
I am trying to compare DateFIeld with timezone.now().date() but its not giving the desired output:
models.py:
class Holiday_List(models.Model):
name=models.CharField(max_length=30)
holi_day=models.DateField(default=timezone.now())
def…

Shivam Sarda
- 37
- 2
- 9
2
votes
4 answers
Improve performance of querys in Postgresql with an index
I have in PostgreSQL tables, each with millions of records and more that one hundred fields.
One of them is a date field, which we filter by this in our queries. The creation of an index for this date field improved the performance of the queries…

Pedro Muñoz
- 285
- 3
- 16
2
votes
2 answers
Subtract dates in django
I'm trying to subtract two dates. I read that it could be done as simples as subtracting two class attributes but I get this error when I execute manage.py runserver
expected string or bytes-like object
code:
class example(models.Model):
date1…

João Victor
- 23
- 3
2
votes
1 answer
How do I set the output format for django rest framework datefield
I have the following very simple serializer:
from rest_framework import serializers
class EmailSendSerializer(serializers.Serializer):
date = serializers.DateField(format='%B')
My understanding of the docs…
user5878688
2
votes
1 answer
django forms DateField
I have a field in my my form named birthdate like:
class Personal_info_updateForm(forms.Form):
birthdate = forms.DateField(widget=SelectDateWidget(years=[y for y in range(1930,2050)]))
..
..
views.py
def personal_info(request):
mc =…

Nikhil Verma
- 241
- 2
- 3
- 10
2
votes
1 answer
Vaadin Datefield doesn't recognize weeks in SimpleDateTime formats
My core problem is that I want to show the year's week number and the year itself in a Vaadin date-field. For example the user picks the 6th February 2018. The date-field should format its value like "06 2018".
As I understood the documentation of…

OddDev
- 3,644
- 5
- 30
- 53
2
votes
1 answer
Django DateField to infinity get 'OverflowError: date value out of range'
In my Django model a DateField(representing an expiredate) could by infinite, i use as infinite date the calue of 'datetime.datetime.max', but what i get is
OverflowError: date value out of range
The db i'm using is postgresql.
Why this error?…

Giuseppe
- 363
- 5
- 19
2
votes
1 answer
How to change order of Date of Birth Fields in CakePHP 3 Form
I am comparatively new to CakePHP3. I am creating a form with a Date of Birth field in it, with dob field name.
echo $this->Form->input('dob',['label'=>'Date of Birth']);
Fields are rendered in Year - Month - Day sequence. I want it be rendered in…

Arvind K.
- 1,184
- 2
- 13
- 27
2
votes
1 answer
Django DateField form generates None in cleaned_data
After selecting dates from DateField's form in django and hitting submit button, is_valid() succeeds, but cleaned_data shows None.
Does anyone know what is the issue? Thanks
forms.py
class DateForm(forms.Form):
day_from =…

Peter
- 21
- 1
2
votes
1 answer
Vaadin - PopupDateField not accepting multiple input date formats
In my project I have a standard DateField format as "dd MMM yyyy". I used setDateFormat("dd MMM yyyy") to se this format. But now users want to enter "MM/dd/yyyy", "MM-dd-yyyy" and "MM dd yyyy" formats too, with the displayable date MUST still be…

rv.comm
- 675
- 1
- 7
- 10
2
votes
0 answers
react-bootstrap-datetimepicker Icon position
I would to know if anyone knows how to move from right to left the icon used on the right when displaying the bootstrap date field with react-bootstrap-datetimepicker.
I can't find neither in the API doc nor in the demo an example of that?
Thank…

Damien Leroux
- 11,177
- 7
- 43
- 57
2
votes
0 answers
Django 1.2 DateField admin site problem
So, I'm making a Django 1.2 app, and I'm having a problem with the admin site. Here's the models.py:
from django.db import models
from django.contrib.auth.models import User
import datetime
class Dailysales(models.Model):
salesdate =…

rossdavidh
- 1,966
- 2
- 22
- 33