Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
forena
Commits
0dd1e089
Commit
0dd1e089
authored
May 01, 2013
by
metzlerd
Browse files
Allow parameters to be international date formats.
parent
e64c205d
Changes
1
Hide whitespace changes
Inline
Side-by-side
forena.module
View file @
0dd1e089
...
...
@@ -565,7 +565,7 @@ function forena_parameter_form($formid, &$form_state, $parameters, $attributes=
if
(
$value
){
$datetime
=
@
strtotime
(
$value
);
if
(
$datetime
)
{
$value
=
date
(
$options
[
'date_format'
]
,
$datetime
);
$value
=
date
(
'Y-m-d h:i'
,
$datetime
);
}
}
...
...
@@ -600,7 +600,6 @@ function forena_parameter_form($formid, &$form_state, $parameters, $attributes=
}
//If a data_source attr was found then create an array of
$form
[
'params'
][
$id
]
=
array
(
'#type'
=>
$type
,
'#title'
=>
(
$label
)
?
t
(
$label
)
:
t
(
$id
),
...
...
@@ -671,7 +670,21 @@ function forena_parameter_form($formid, &$form_state, $parameters, $attributes=
function
forena_parameter_form_submit
(
$form
,
&
$form_state
)
{
$values
=
$form_state
[
'values'
];
unset
(
$values
[
'params'
][
'submit'
]);
if
(
isset
(
$values
[
'params'
]))
foreach
(
$values
[
'params'
]
as
$key
=>
$value
)
{
$ctl
=
$form
[
'params'
][
$key
];
switch
(
$ctl
[
'#type'
])
{
case
'date_popup'
:
case
'date_select'
:
case
'date_text'
:
$datetime
=
@
strtotime
(
$value
);
if
(
$datetime
)
{
$value
=
$values
[
'params'
][
$key
]
=
date
(
$ctl
[
'#date_format'
],
$datetime
);
}
break
;
}
if
(
is_array
(
$value
))
{
$values
[
'params'
][
$key
]
=
array
();
foreach
(
$value
as
$k
=>
$val
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment