Rework nuove librerie mongo
Signed-off-by: Riccardo Di Dato <r.didato@asdynamics.it>
This commit is contained in:
@@ -30,7 +30,8 @@ try {
|
||||
$tmp->fromName = "I Fatti di Napoli - Newsletter";
|
||||
$tmp->subject = "";
|
||||
$tmp->body = "";
|
||||
$tmp->date = new MongoDate();
|
||||
// $tmp->date = new MongoDate();
|
||||
$tmp->date = new MongoDB\BSON\UTCDateTime( time() * 1000 );
|
||||
$mail = new MailTemplateModel($tmp);
|
||||
|
||||
|
||||
@@ -54,7 +55,8 @@ try {
|
||||
if(!preg_match("/^[0-9]{2}[-][0-9]{2}[-][0-9]{4} [0-9]{2}[:][0-9]{2}$/", $dateString)){
|
||||
throw new GUIException("Il formato della data inserita non è corretto. Per favore segui il seguente formato Date: dd-mm-yyyy hh:ii");
|
||||
}
|
||||
$tmp->date = new MongoDate(strtotime($dateString));
|
||||
// $tmp->date = new MongoDate(strtotime($dateString));
|
||||
$tmp->date = new MongoDB\BSON\UTCDateTime(strtotime($dateString) * 1000);
|
||||
|
||||
GlobalVariables::get("dao")->save($mail);
|
||||
|
||||
@@ -98,11 +100,11 @@ if (strcmp($mailBody, "")==0){
|
||||
</div>
|
||||
<div>
|
||||
<span class="label">Giorno</span>
|
||||
<input type="text" id="datepicker" name="data" value="<?php echo ($edit)? date("d-m-Y",$mail->date->sec):date("d-m-Y");?>">
|
||||
<input type="text" id="datepicker" name="data" value="<?php echo ($edit)? date("d-m-Y",$mail->date->toDateTime()->getTimestamp()):date("d-m-Y");?>">
|
||||
</div>
|
||||
<div>
|
||||
<span class="label">Ora</span>
|
||||
<input type="text" id="timepicker" name="time" value="<?php echo ($edit)? date("H:i",$mail->date->sec):date("H:i");?>">
|
||||
<input type="text" id="timepicker" name="time" value="<?php echo ($edit)? date("H:i",$mail->date->toDateTime()->getTimestamp()):date("H:i");?>">
|
||||
</div>
|
||||
<div>
|
||||
<!-- <div style="margin:auto;width:1024px;" contenteditable="true"><?php echo $mailBody;?></div>-->
|
||||
|
||||
Reference in New Issue
Block a user