TadvGridFilterPanel on TadvStringGrid filters dates wrong - delphi-10.4-sydney

I've got a TAdvStringGrid connected to a TAdvGridFilterPanel. The grid contains several columns of which 4 are dates. The locale of my PC is 'nl-NL' (Dutch). Date format in The Netherlands is 'dd-mm-yyyy'. When I filter dates it doesn't filter correctly. Things I tried that did not help:
In the OnGetFormat returned the ssDate for date columns
Fiddled arround with FormatSettings (local and global) with DateFormat and DateSeparator. This did solve some of the display problems. Date were display as '31/12/2000'. After changing the FormatSettings this changed to '31-12-2000'. But it's not nice to use the global FormatSetting so discarded that solution.
Tried to find an event that fires on compare. If it exists, I didn't find it.
In other words. Or I'm doing something wrong or there's a bug in the TMS code. Any idea's?

Related

Google Sheets - DATE format not working on imported Date in TEXT format

I text based .csv file with a semicolon separated data set which contains date values that look like this
22.07.2020
22.07.2020
17.07.2020
09.07.2020
30.06.2020
When I go to Format>number> I see the Google sheets has automatic set.
In this state I cannot use and formulas with this data.
I go to Format>number> and set this to date but formulas still do not see the actual date value and continue to display an error
Can someone share how I can quickly activate the values of this array so formulas will work against them?
I would be super thankful
Where the date are in column A, starting in cell A1, this formula will convert to DATE as a number, after which you apply formatting to Short Date style.
=ARRAYFORMULA(IF(A1:A="",,DATE(RIGHT(A1:A,4),MID(A1:A,4,2),LEFT(A1:A,2))))
Hopefully(!) the dates stay as text, otherwise Google Sheets would sometimes detect MM/dd/yyyy instead of dd/MM/yyyy, and you won't be able to distinguish between July 9th and September 7th in your example.
Solution #1
If your locale is for instance FR, you can then apply
=arrayformula(if(A1:A="";;value(A1:A)))
solution#2
you can try/adapt
function importCsvFromIdv1() {
var id = 'the id of the csv file';
var csv = DriveApp.getFileById(id).getBlob().getDataAsString();
var csvData = Utilities.parseCsv(csv);
csvData.forEach(function(row){
date = row[0]
row[0] = date.substring(6,10)+'-'+date.substring(3,5)+'-'+date.substring(0,2)
})
var f = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
f.getRange(1, 1, csvData.length, csvData[0].length).setValues(csvData);
}
First thanks to those that suggested a fix. I am not really a programmer and get cold sweats when I see suggesting of running scripts to solve simple problems. Sorry guys.
So the (non programmer) solution with the dates was to do a find/replace (CTRL + H) and replace all the (.)dots with (/)slashes, then to make sure the column is formatted as a date, then Google finally understands it as a date.
With the accounting values as well, I had to do the same find/replace to remove all the ' between thousands, then google woke up and understood them as numbers.
I am significantly underwhelmed by this from Google. They are getting too fat and lazy. They need some competition.

vb6 error 380 Datepicker, bust just in certain dates

Im having a problem with a datepicker on vb6, but this jus happen on certain dates, for example 31/01/2017, but with another dates it works fine.
I appreciate the help
This almost certainly has to do with how you are setting the date in the control.
For instance if the control's value is ANY month that does not have 31 days then you will get that error. Trying to set the control to 31/02/2017 would cause an error 380.
There are two approaches you can take to fix this.
Reverse the order you set the date components.
dtFecha.Year = Year(fcsAux.Fields("xf3ch4"))
dtFecha.Month = Month(fcsAux.Fields("xf3ch4"))
dtFecha.Day = Day(fcsAux.Fields("xf3ch4"))
Set the Value property instead of the date components. dtFecha.Value = "31/02/2017"
dtFecha.Value = rcsAux.Fields("xf3ch4").Value
The first approach ensures the month is always appropriate for the day. The second approach sets the entire value at one shot and should be a valid date.

Displaying the timezone properly in XSLT

Was using the below tag for displaying the timezone which was working fine until now when the daylight saving has happened and as our server is in UK displaying the time as 01/04/2015 03:43:00 PM + 0100, we would also like to have the timezone displayed, please advice.
Tag Used Previously:
date:format-date(date:date-time(), 'dd/MM/yyyy hh:mm:ss a Z')
Regards
Arvind
If by "properly" you mean you want it displayed as "BST" (for British Summer Time) then there isn't actually enough information in the date/time value to do this - a time-zone offset of +1 occurs in many different timezones near the Greenwich meridian.
You're using the EXSLT library for formatting dates and times. This is based on Java's SimpleDateFormat class, so you could try your luck with the timezone designator z instead of Z.
Alternatively, if you've got access to XSLT 2.0, you can use the format-dateTime() function. This suffers from the same problem (the dateTime value only stores an offset, which doesn't actually tell you the name of the timezone). But you can give the processor a clue by setting the 5th argument of format-dateTime() to "Europe/London", in which case it might be able to work it out.

Format causes a subtraction of exactly 4 hours from the hour field every time

For all of my dates, Format subtracts exactly 4 hours from the hour field.
Here is an example for clarification:
When I retrieve a date in Microsoft SQL Server Management Studio, the date column returns dates in this format: 2014-10-30 11:19:02.733.
When I execute the same command using sql and display the value in a gridpanel, it is displayed in this format: 2014-10-30T11:19:02.733.
However, When I try to use Format="yyyy-M-d, HH:mm", the date is returned as 2014-10-30 07:19:02.
For easier comparison, this is what the difference is:
2014-10-30 11:19:02.733
2014-10-30T11:19:02.733
2014-10-30 07:19:02
What could cause the removal of exactly 4 hours every single time?
Thank you.
Additional code:
<ext:DateColumn ID="Column6" runat="server" Text="When" DataIndex="time" Flex="1" Format="yyyy-M-d, HH:mm" />
For anyone who stumbles upon this question in the future:
I found the solution, based on Julien's guess!
I changed the timezone on my pc and it consequentially changed the value again.
It turns out, that the way around this is is to add a type to the modelField. It would look something like this <ext:ModelField Name="time" Type="Date" />.
For some reason, this prevents the client-side time-zone override.

DateAdd() returns faulty Date in SQL Server Reporting Services

I have a report that takes a date as a parameter.
If I use =Parameters!Date.Value, the report runs fine.
However, if I use =DateAdd("d", 1, Parameters!Date.Value), the report is left blank, even though the formats are exactly the same:. (Note: it simply cannot run. It's not that there are no values to return as the field names don't return either.)
I have also tried =DateAdd(DateInterval.Date, 1, Parameters!Date.Value)
=DateAdd("d", 1, Parameters!Date.Value)
=DateValue(FormatDateTime(DateAdd("d", 1, Parameters!Date.Value), DateFormat.ShortDate )) and many variations thereof but I can't seem to crack it!
Update
If I use DateInterval.Month instead of DateInterval.Day then the date is still incremented as desired (12/22/2010) but the table shows up! Interesting how my local settings are dd-mm-yyyy and these dates are mm-dd-yyyy.
Try changing the locale of the report to EN-GB (I'm assuming you're in the UK), as the report might be getting confused between different date formats.