Approval Date

Mar 7, 2012 at 1:03 AM
Edited Mar 7, 2012 at 1:04 AM

Hi, just want to say thanks for this project, it has helped me out immensely.

I have a small modification I made to the code which may be useful for others.

In Features\VersionInfoColumns\VersionInfoColumns.EventReceiver.cs change the line

string columnApprovalDate = "<Field Type=\"Text\" " +

to the following

string columnApprovalDate = "<Field Type=\"DateTime\" " +

In UpdateVersionColumns\UpdateVersionColumns.cs change the line to look like the following:

item["Approval Date"] = DateTime.Now.ToString;

to the following

item["Approval Date"] = DateTime.Now; 

For me this was an important change as I am in Australia. Having the column as a DateTime, regional settings would be used for formatting the column data. The other upside is that I can sort by Date/Time correctly.