datetype single text change the value - symfony

I have a DateType input in my formBuilder. In my form, when I put 12/12/1500, it changes the date to 12/12/1901. I use it with widget single_text, format dd/MM/yyyy and input datetime
I have removed all the validations constraint on the field, so it has to come from the Type
How can I change this unwanted behaviour?

From the documentation, http://symfony.com/doc/current/reference/forms/types/date.html#input
"If timestamp is used, DateType is limited to dates between Fri, 13 Dec 1901 20:45:54 GMT and Tue, 19 Jan 2038 03:14:07 GMT on 32bit systems. This is due to a limitation in PHP itself."
Try changing the 'input' option for the your date field.

Related

CRM365 doesn't convert to the local time only the date 1 October 1983 on the form

We have the Datebirth field on Contact entity form. When a user picks the date 1 October 1983, the system automatically changes it to 30 September 1983.
However, this kind of magic doesn't happen with other dates.
The field behavior is User Local. Format is Date Only. Our timezone GTM +3. Crm converts it to GTM +0 on changing field value correctly. Also we cannot change the behavior.
What could be the mysticism of 10/1/1983?
We’ve been analyzing this problem for 2 days. Finally we found the core of the problem. The issue is that Sep 30 1983 and Sep 30 1982 are dates of daylight-saving time (DTS).
For example, when the date 1 Oct 1983 00:00 is picked and saved into database (MS SQL Server), it will be converted to the Greenwich Mean Time +0 (GMT +0). In our case (GMT +3) the time must be 09/30/1983 21:00:00.
But an extra hour is subtracted in function [DB_name]/Programmability/Scalar-valued functions/fn_UTCToTzSpecificLocalTime, because on switching to winter time the clock is put back an hour. As a result, the time 09/30/1983 20:00:00 is saved in DB, instead of 09/30/1983 21:00:00.
Therefore, when crm displays the time 09/30/1983 20:00:00 on a form, it converts it to local time (adds 3 hours). This is why we see 09/30/1983 23:00:00.
We added 1 hour in DB to solve this problem.

Is there a way to take a fixed date and change it into a date table in Lua without specifically assigning each value?

I have a date which is being fed into my script in the following format:
dateTime = "Fri Oct 18 10:08:02 UTC 2019"
Is there a way to reformat this so that I can quickly call each element as I like without explicitly splitting out using string.sub (for example)?
E.g. So that I can:
Subtract one date from another to find out age (using current time and birth/established date)
Add hours dependant on the timezone (given that I have a timezone in the format "+3")
Find if the time was between a range (e.g. the request was sent between 9am and 5pm GMT)
Lua does not have a built-in date or time type like other languages.
Lua 5.3 Reference Manual 2.1 Values and Types
There are eight basic types in Lua: nil, boolean, number, string,
function, userdata, thread, and table.
Lua 5.3 Reference Manual 6 Standard Libraries
Either implement them yourself or find existing modules that suit your needs.
A simple way would be to parse your date time string using captures
Checkout http://lua-users.org/wiki/DateAndTime for suggestions.

Suggest Box not working for SQL

I'm seeing an error when typing into a suggest box:
Thu Dec 08 10:45:58 GMT-700 2016
Speckle models do not support distinct sorted field values. Error: Speckle models do not support distinct sorted field values.
E
Thu Dec 08 10:45:58 GMT-700 2016
Query for field suggest oracle.: (Error) : Speckle models do not support distinct sorted field values.
E
Thu Dec 08 10:45:58 GMT-700 2016
Query for field suggest oracle. failed.
Value of the suggest is set to:
#datasource.query.filters.project._equals
and the suggestions are set to the datasource and field project.
I have also un-checked "Value is a record" as that is an error already in the editor.
I can use a normal text box and the same value to filter the data which works fine but would prefer the ability to select from suggest.
Support for using suggest text field with SQL is coming in the next few weeks. I will respond to this question again when it is added.
CloudSQL support for Suggest text field is released. Please give it a try.

Strange behavior with created date

I have something strange with time of created objects.
I'm in france, and the server time is ok.
When I create a new document at 09:45, I have thoses data in the catalog :
Date 2012-07-13T07:45:01+00:00
ModificationDate 2012-07-13T07:45:01+00:00
created 2012/07/13 05:44:37.933325 GMT
modified 2012/07/13 05:45:1.990650 GMT
CreationDate 2012-07-13T07:44:37+00:00
created and modified are 4 hours before !
Is there a way to fix the timezone or something to correct that ?

Drupal Views outputting wronf date - Dec 31, 1969

Issue: Drupal Views module only displays Wed Dec 31, 1969 for date fields
I have created a CCK content field type called field_gse_event_start_time. I also have several views displays that use this field - a calendar view, a table view, and a block view for the home page. I also have a themed node template for the event content type that this field belongs to.
The start time field requires a 'to' date as well as a from date. I have tried to change the type of the field_gse_event_start_time to date, datetime, and datestamp. In all cases the node display of the fields is correct, but any view displays Wed Dec 31, 1969.
I am sure this is due to some casting error or null, which adjusts to this pre-epoc value.
I just don't even know where to begin or how to fix.
Some config
Drupal core 6.26
ctools-6.x-1.8.tar
date-6.x-2.9.tar
views-6.x-2.16.tar
You probably know that the 1969 date is returned by date() when you pass it an invalid epoch time and you have a negative timezone offset. So, date() will default the invalid epoch to 1, and the timezone offset makes it pre-epoch.
Why this is happening in your Drupal view is probably because of a views field handler expecting the wrong format. What field type are you using for field_gse_event_start_time?

Resources