mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Fix #1936 don't convert date-only timestamps in extra vars and member birthday column
This commit is contained in:
parent
96620b6a8c
commit
a5f056284c
3 changed files with 13 additions and 7 deletions
|
|
@ -361,7 +361,7 @@ class ExtraItem
|
|||
return nl2br($value);
|
||||
|
||||
case 'date' :
|
||||
return zdate($value, "Y-m-d");
|
||||
return sprintf('%s-%s-%s', substr($value, 0, 4), substr($value, 4, 2), substr($value, 6, 2));
|
||||
|
||||
case 'language':
|
||||
return Rhymix\Framework\Lang::getSupportedList()[$value]['name'];
|
||||
|
|
@ -559,8 +559,9 @@ class ExtraItem
|
|||
// datepicker javascript plugin load
|
||||
Context::loadJavascriptPlugin('ui.datepicker');
|
||||
|
||||
$formattedValue = $value ? sprintf('%s-%s-%s', substr($value, 0, 4), substr($value, 4, 2), substr($value, 6, 2)) : '';
|
||||
$buff[] = '<input type="hidden" class="rx_ev_date" name="' . $column_name . '" value="' . $value . '" />';
|
||||
$buff[] = '<input type="text" id="date_' . $column_name . '" value="' . zdate($value, 'Y-m-d') . '" class="date" autocomplete="off" />';
|
||||
$buff[] = '<input type="text" id="date_' . $column_name . '" value="' . $formattedValue . '" class="date" autocomplete="off" />';
|
||||
$buff[] = '<input type="button" value="' . lang('cmd_delete') . '" class="btn" id="dateRemover_' . $column_name . '" />';
|
||||
$buff[] = '<script type="text/javascript">';
|
||||
$buff[] = '//<![CDATA[';
|
||||
|
|
|
|||
|
|
@ -611,7 +611,7 @@ class memberAdminView extends member
|
|||
'onchange="jQuery(\'#date_birthday\').val(this.value.replace(/-/g,\'\'));" readonly="readonly" /> ' .
|
||||
'<input type="button" value="%s" class="btn dateRemover" />',
|
||||
$memberInfo['birthday'],
|
||||
zdate($memberInfo['birthday'], 'Y-m-d', false),
|
||||
$memberInfo['birthday'] ? sprintf('%s-%s-%s', substr($memberInfo['birthday'], 0, 4), substr($memberInfo['birthday'], 4, 2), substr($memberInfo['birthday'], 6, 2)) : '',
|
||||
$lang->cmd_delete);
|
||||
}
|
||||
else if($formInfo->name == 'find_account_question')
|
||||
|
|
@ -795,7 +795,8 @@ class memberAdminView extends member
|
|||
}
|
||||
else if($extendForm->column_type == 'date')
|
||||
{
|
||||
$extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
|
||||
$formattedValue = $extendForm->value ? sprintf('%s-%s-%s', substr($extendForm->value, 0, 4), substr($extendForm->value, 4, 2), substr($extendForm->value, 6, 2)) : '';
|
||||
$extentionReplace = array('date' => $formattedValue, 'cmd_delete' => $lang->cmd_delete);
|
||||
$template = '<input type="hidden" class="rx_ev_date" name="%column_name%" id="date_%column_name%" value="%value%" />' .
|
||||
'<input type="date" placeholder="YYYY-MM-DD" class="inputDate" value="%date%" ' .
|
||||
'onchange="jQuery(\'#date_%column_name%\').val(this.value.replace(/-/g,\'\'));" readonly="readonly" /> ' .
|
||||
|
|
|
|||
|
|
@ -141,9 +141,9 @@ class memberView extends member
|
|||
$target = $memberInfo->image_mark;
|
||||
$item->value = '<img src="'.$target->src.'" alt="' . lang('member.image_mark') . '" />';
|
||||
}
|
||||
elseif($formInfo->name == 'birthday' && $memberInfo->birthday)
|
||||
elseif($formInfo->name == 'birthday' && $memberInfo->birthday && preg_match('/^[0-9]{8}/', $item->value))
|
||||
{
|
||||
$item->value = zdate($item->value, 'Y-m-d');
|
||||
$item->value = sprintf('%s-%s-%s', substr($item->value, 0, 4), substr($item->value, 4, 2), substr($item->value, 6, 2));
|
||||
}
|
||||
elseif($formInfo->name == 'phone_number' && $memberInfo->phone_number)
|
||||
{
|
||||
|
|
@ -175,7 +175,11 @@ class memberView extends member
|
|||
}
|
||||
elseif($formInfo->type=='date')
|
||||
{
|
||||
$item->value = zdate(is_array($orgValue) ? array_first($orgValue) : $orgValue, 'Y-m-d');
|
||||
$item->value = is_array($orgValue) ? array_first($orgValue) : $orgValue;
|
||||
if (preg_match('/^[0-9]{8}/', $item->value))
|
||||
{
|
||||
$item->value = sprintf('%s-%s-%s', substr($item->value, 0, 4), substr($item->value, 4, 2), substr($item->value, 6, 2));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue