1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-16 12:36:26 +02:00

News datestamp now retains value when editing. Updated datetime picker.

This commit is contained in:
Cameron
2013-02-20 17:38:34 -08:00
parent 312dad5b3b
commit 50b922f588
4 changed files with 1954 additions and 1537 deletions

View File

@ -1974,6 +1974,14 @@ class admin_newspost
else else
{ {
// $text .= $frm->selectbox("cat_id",$this->news_category,$_POST['cat_id']); // $text .= $frm->selectbox("cat_id",$this->news_category,$_POST['cat_id']);
$catopt = array();
foreach ($this->news_categories as $row)
{
$catopt[$row['category_id']] = $tp->toHTML($row['category_name'], FALSE, "LINKTEXT");
}
$text .= $frm->selectbox("cat_id", $catopt, $_POST['cat_id']);
/*
$text .= $frm->select_open('cat_id'); $text .= $frm->select_open('cat_id');
foreach ($this->news_categories as $row) foreach ($this->news_categories as $row)
@ -1981,6 +1989,8 @@ class admin_newspost
$text .= $frm->option($tp->toHTML($row['category_name'], FALSE, "LINKTEXT"), $row['category_id'], varset($_POST['cat_id']) == $row['category_id']); $text .= $frm->option($tp->toHTML($row['category_name'], FALSE, "LINKTEXT"), $row['category_id'], varset($_POST['cat_id']) == $row['category_id']);
} }
$text .= "</select>"; $text .= "</select>";
*/
} }
$text .= " $text .= "
</td> </td>
@ -2012,7 +2022,7 @@ class admin_newspost
"; ";
//XXX multiple-selections at once. (comma separated) - working //XXX multiple-selections at once. (comma separated) - working
$text .= $frm->selectbox('news_render_type', $this->news_renderTypes, vartrue($_POST['news_render_type']), "multiple=1",array(NWSLAN_74))." $text .= $frm->selectbox('news_render_type', $this->news_renderTypes, vartrue($_POST['news_render_type']), "multiple=1")."
<div class='field-help'> <div class='field-help'>
".NWSLAN_74." ".NWSLAN_74."
</div> </div>
@ -2255,7 +2265,7 @@ class admin_newspost
<div class='field-spacer'> <div class='field-spacer'>
"; ";
$text .= $frm->datepicker("news_datestamp",vartrue($_POST['news_datestamp']),"type=datetime"); $text .= $frm->datepicker("news_datestamp",vartrue($_POST['news_datestamp']),"type=date"); //XXX should be 'datetime' when working correctly.
$text .= "</div>"; $text .= "</div>";
/* /*

View File

@ -110,7 +110,7 @@ class convert
function toMask($mask, $legacy = false) function toMask($mask, $legacy = false)
{ {
$convert = array( $convert = array(
'%Y' => 'yy', '%Y' => 'yyyy', // jquery-ui docs say 'yy' but yy produces '13' instead of '2013'
'%d' => 'dd', '%d' => 'dd',
'%m' => 'mm', '%m' => 'mm',
'%B' => 'MM', // Full month name, based on the locale '%B' => 'MM', // Full month name, based on the locale

View File

@ -157,6 +157,16 @@ $(document).ready(function()
// Dates -------------------------------------------------- // Dates --------------------------------------------------
/*
// http://tarruda.github.com/bootstrap-datetimepicker/
// $('.e-datetime').datetimepicker();
$('.e-datetime').datetimepicker({
language: 'en',
pick12HourFormat: true
});
*/
$("input.e-date").each(function() { $("input.e-date").each(function() {
$(this).datepicker({ $(this).datepicker({
@ -168,11 +178,19 @@ $(document).ready(function()
}); });
$("input.e-datetime").each(function() { $("input.e-datetime").each(function() {
// var name = $(this).attr("name");
// var val = $(this).val();
// alert(name + ': ' + val);
$(this).datetimepicker({ $(this).datetimepicker({
dateFormat: $(this).attr("data-date-format"), dateFormat: $(this).attr("data-date-format"),
timeFormat: $(this).attr("data-time-format"), timeFormat: $(this).attr("data-time-format"),
defaultDate: $(this).val(),
defaultValue: $(this).val(),
setDate: $(this).val(),
ampm: $(this).attr("data-date-ampm"), ampm: $(this).attr("data-date-ampm"),
firstDay: $(this).attr("data-date-firstday"), // firstDay: $(this).attr("data-date-firstday"),
showButtonPanel: true showButtonPanel: true
}); });
}); });

File diff suppressed because it is too large Load Diff