activerecord-sqlserver-adapter icon indicating copy to clipboard operation
activerecord-sqlserver-adapter copied to clipboard

dateformat to ISO 8601

Open YvesR opened this issue 8 years ago • 9 comments

Change date format for SQL server and Azure that date format will always be ISO 8601 format.

YvesR avatar Jun 16 '17 09:06 YvesR

Hello Ken,

  1. about change request: I did remove the comment and renamed the variable from dateformat to dateformat_iso8601. How do I update this pull request now? As I can only create a new pull request as far as I can see. Edit If I see correct and read to late, I just commit more changes in my master, correct :)?

  2. I checked the details log. I did not took care of the tests. After changing the code I did some tests with rails applications. But going into tests now I see where they fails.

But please clarify: I need to change the tests as well to make them run successful? I can change the values from us english format to iso 8601 in the tests as well, but I am not sure if this is right to just change the tests like this. Also in ``column_test_sqlserver.rb' the test fail in line 285, I wounder about this, because we do not set language where I changed the code and string cast like this depends on language we do set before.

YvesR avatar Jun 19 '17 06:06 YvesR

Hello @metaskills,

before I modify the tests, can you take a look on my last comment? It looks suspicious to me changing the tests to make them "just work".

YvesR avatar Jul 20 '17 10:07 YvesR

Will do this weekend.

metaskills avatar Jul 20 '17 11:07 metaskills

Saw that you just set a release 4 days ago. Since this is not included, did you have the time to take a look at this?

YvesR avatar Oct 06 '17 12:10 YvesR

I have not forgotten! Just wanted to get that bug fix out... I'll be on this soon!

metaskills avatar Oct 06 '17 12:10 metaskills

@metaskills When is soon? 😆

stefanahman avatar Apr 22 '18 17:04 stefanahman

Hi @YvesR, I am jumping into some old issues/PR now...

Do you still need this merged? Can you give me some context and maybe rebase your branch and resolve the conflicts?

wpolicarpo avatar May 15 '20 20:05 wpolicarpo

@wpolicarpo Hi. thanks for looking up. Well this fix is still useful and it make sense to do this. I was struggling with tests as we have to remove failed tests to make this work, but I wasn’t in the position to decide this.

YvesR avatar May 16 '20 03:05 YvesR

I am not totally sure that it is connected but I currently experience issue of datetime formatting after migrating grom rails 5 to 6 I issue update_attribute on a record with updated_on timestamp and I get incorrect SQL like below: EXEC sp_executesql N'UPDATE [options] SET [value] = @0, [updated_on] = @1 WHERE [options].[name] = @2; SELECT @@ROWCOUNT AS AffectedRows', N'@0 nvarchar(max), @1 datetime, @2 varchar(50)', @0 = N'', @1 = '2021-08-27 09:55:47 UTC.16', @2 = 'JournalReportIDs' and '2021-08-27 09:55:47 UTC.16' is clearly improper for mine SQL2012. Any idea from where this UTC.16 extension comes in? I will disable timestamping for now... This part after UTC seems like .%L formatting (as it is random)... Sorry - mine issue is not related to this pull; I was having an old configure_connection overwrite which was not initializing datetime formatter; I would actually update README and discourage overwriting configure_connection as it is doing important stuff

krzcho avatar Aug 27 '21 10:08 krzcho