Default value for custom field of date type
Moderators: Developer, Contributor
Re: Default value for custom field of date type
It don't have MSSQL server, so it is difficult to find the issue
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/
Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
=> http://deboutv.free.fr/mantis/
Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
Re: Default value for custom field of date type
are you able to give me any pointers - i'm not too up on PHP but have programmed in other languages.
Thanks
Thanks
Re: Default value for custom field of date type
The issue is not PHP but SQL syntax.
Want more plugins to customize Mantis?
=> http://deboutv.free.fr/mantis/
Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
=> http://deboutv.free.fr/mantis/
Mantis: 1.1.0, 1.1.0a2
PHP: 5.0.4
SQL: MySQL 5.0.19
OS: Linux
Re: Default value for custom field of date type
do you know which of the scripts its in and I'll have a look?
Thanks
Thanks
Re: Default value for custom field of date type
In Mantis 1.2, it will be possible to set the default value for a custom date field to values like: {tomorrow}, {yesterday}, {+ 3 days}, {-2 days}, {next week}.
Migrate your MantisBT to the MantisHub Cloud
Re: Default value for custom field of date type
Hello,
I tried on mantis 1.2.5 do add default value to date custom field like {+5 days} or {tomorrow} byt my default custom field remain empty...
A bug ? a wrong configuration ?
Regards
I tried on mantis 1.2.5 do add default value to date custom field like {+5 days} or {tomorrow} byt my default custom field remain empty...
A bug ? a wrong configuration ?
Regards
Re: Default value for custom field of date type
Hello
Sorry I didn't explained well.
My custom field is showned on my report.. I can fill it and set a date using the boxes. (this is working fine)
The problem is that I want to set a default value :
I supposed that the date boxes of the custom field should be set to today+1day when I set {tomorrow} on default value of the custom field properties.
But it remained not set to today + 1day.. the boxes are unset and I need to select them.. (no date is set)
hope to be clear (I made a screenshot copy)
Sorry I didn't explained well.
My custom field is showned on my report.. I can fill it and set a date using the boxes. (this is working fine)
The problem is that I want to set a default value :
I supposed that the date boxes of the custom field should be set to today+1day when I set {tomorrow} on default value of the custom field properties.
But it remained not set to today + 1day.. the boxes are unset and I need to select them.. (no date is set)
hope to be clear (I made a screenshot copy)
- Attachments
-
- date_mantis_config.png (6.93 KiB) Viewed 11851 times
-
- date_mantis.png (1.45 KiB) Viewed 11851 times
Re: Default value for custom field of date type
I understood your issue, but I was not able to reproduce it. ({tried tomorrow} and {+5 days}
I tried with IE8 and FF6.
Are you able to reproduce the issue with Mantis2Go ?
I tried with IE8 and FF6.
Are you able to reproduce the issue with Mantis2Go ?
Re: Default value for custom field of date type
I dind't tried with mantis2go but a real install on my server...
I don't think this is a navigator problem but more surely à php date() function
On this page : http://docs.mantisbt.org/master-1.2.x/e ... STOMFIELDS
we can read :
I don't think this is a navigator problem but more surely à php date() function
On this page : http://docs.mantisbt.org/master-1.2.x/e ... STOMFIELDS
we can read :
So it sound that it could be a strtotime() function, but I don't know how to test or debug..Custom fields of type date can be defaulted to a specific dates or to relative dates. Typically relative dates is the scenario that makes sense in most of the cases. The format for specific dates is an integer which indicates the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT), which is the format consumed by the PHP date() method. The relative scenario expects default values like {tomorrow}, {yesterday}, {+2 days}, {-3 days}, {next week}, etc. The curly brackets indicate that this is a logical value which is then evaluated using the PHP strtotime() function.
Re: Default value for custom field of date type
Create a file tstrotime.php and run it in your browser
The result should be someting like: 1315067165
Code: Select all
<?php
echo strtotime( '+5 days');
?>
Re: Default value for custom field of date type
I'm not at the office now but i made this test and it worked... strtotime is ok...
It is like my {+5 days} is not interprated ... is there a ddebug mode under mantis ??
It is like my {+5 days} is not interprated ... is there a ddebug mode under mantis ??
Re: Default value for custom field of date type
Hello
I found what I thought to be an issue.
In fact the field is well filled in when we create it.
But if the field already exist, changing the parameters don't impact it..
after mind, this is not abnormal...
So no issue. this is working fine. Sorry fr bandwidth.
I found what I thought to be an issue.
In fact the field is well filled in when we create it.
But if the field already exist, changing the parameters don't impact it..
after mind, this is not abnormal...
So no issue. this is working fine. Sorry fr bandwidth.