Page 3 of 3

Re: Default value for custom field of date type

Posted: 26 Mar 2008, 09:42
by deboutv
It don't have MSSQL server, so it is difficult to find the issue :(

Re: Default value for custom field of date type

Posted: 26 Mar 2008, 10:02
by dyawlak
are you able to give me any pointers - i'm not too up on PHP but have programmed in other languages.

Thanks

Re: Default value for custom field of date type

Posted: 26 Mar 2008, 10:24
by deboutv
The issue is not PHP but SQL syntax.

Re: Default value for custom field of date type

Posted: 26 Mar 2008, 13:09
by dyawlak
do you know which of the scripts its in and I'll have a look?


Thanks

Re: Default value for custom field of date type

Posted: 27 Mar 2008, 05:31
by vboctor
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}.

Re: Default value for custom field of date type

Posted: 29 Aug 2011, 10:36
by Guil
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

Re: Default value for custom field of date type

Posted: 29 Aug 2011, 11:25
by atrol
Did you enable "Display When Reporting Issues" ?

Re: Default value for custom field of date type

Posted: 29 Aug 2011, 13:19
by Guil
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)

Re: Default value for custom field of date type

Posted: 29 Aug 2011, 14:43
by atrol
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 ?

Re: Default value for custom field of date type

Posted: 29 Aug 2011, 16:06
by Guil
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 :
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.
So it sound that it could be a strtotime() function, but I don't know how to test or debug..

Re: Default value for custom field of date type

Posted: 29 Aug 2011, 16:27
by atrol
Create a file tstrotime.php and run it in your browser

Code: Select all

<?php
echo strtotime( '+5 days');
?>
The result should be someting like: 1315067165

Re: Default value for custom field of date type

Posted: 29 Aug 2011, 20:46
by Guil
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 ?? :D

Re: Default value for custom field of date type

Posted: 30 Aug 2011, 07:03
by atrol
Again: Are you able to reproduce the issue with Mantis2Go ?

Re: Default value for custom field of date type

Posted: 06 Oct 2011, 14:38
by Guil
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.