Set custom date field to default to current date and time
Moderators: Developer, Contributor
-
pay2play
Set custom date field to default to current date and time
Hello All,
I have created a custom date field for Date Closed which I need for reporting purposes. Currently the custom date field only shows 3 drop downs for year, month, and day. When submitted, the output shows the correct year, month, and day but with the time of 00:00:00. Is it possible to set custom date field to current date and time? Any help would be greatly appreciated!
I have created a custom date field for Date Closed which I need for reporting purposes. Currently the custom date field only shows 3 drop downs for year, month, and day. When submitted, the output shows the correct year, month, and day but with the time of 00:00:00. Is it possible to set custom date field to current date and time? Any help would be greatly appreciated!
-
pay2play
Re: Set custom date field to default to current date and tim
I am running Mantis version 1.2.10
-
pay2play
Re: Set custom date field to default to current date and tim
Anyone?? Any suggestions??
Re: Set custom date field to default to current date and tim
Where do you see the time?pay2play wrote:but with the time of 00:00:00
Setting the current date is possible by setting the default value topay2play wrote:Is it possible to set custom date field to current date and time?
Code: Select all
{+0 days}-
pay2play
Re: Set custom date field to default to current date and tim
The time stamp of 00:00:00 shows on the custom field column on the View Bug page and when the custom date field is exported to CSV,Excel. Setting the default date is not an issue, it's setting the field to the current date and time that I am trying to find a solution to.
Re: Set custom date field to default to current date and tim
Not in a standard installation with default settings. Did you set short_date_format?pay2play wrote:The time stamp of 00:00:00 shows on the custom field column on the View Bug page and when the custom date field is exported to CSV,Excel.
-
pay2play
Re: Set custom date field to default to current date and tim
Yes, I changed the short_date_format in my config_inc file to include H:i. If not, the date submitted and updated fields will not show a time when they are exported.
-
pay2play
Re: Set custom date field to default to current date and tim
Any suggestions on where to start?
Re: Set custom date field to default to current date and tim
There was a user who implemented DATETIME custom fields, but this was for version 1.1.4
http://www.mantisbt.org/bugs/view.php?id=6325
http://www.mantisbt.org/bugs/view.php?id=6325
-
pay2play
Re: Set custom date field to default to current date and tim
I used the info in the link you provided, and the H:1 fields are now displayed as drop downs. The problem I am now having is when setting the default value of the field to {today} or {+0 days} my custom date field show the correct year, day, and month, however the H:1 fields are blank and must be chosen from a drop down.
-
pay2play
Re: Set custom date field to default to current date and tim
I only needed this custom date field to display when an issue is closed, however when setting it to only display on close it would not default to the current date, month, year, and time. My work around was to just create a custom string in my custom_strings_inc file and rename due_date to Date Closed and then set the due_date field to display on the bug change page.