Store datetime in UTC format now, and fix presentation of TZUTC. Also standardise message summaries on Notifications
This commit is contained in:
@@ -8,7 +8,7 @@ use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Notifications\Notification;
|
||||
|
||||
use App\Classes\FTN\Message;
|
||||
use App\Models\{Echoarea,Echomail,Setup};
|
||||
use App\Models\{Echoarea,Echomail,Netmail,Setup};
|
||||
|
||||
abstract class Echomails extends Notification //implements ShouldQueue
|
||||
{
|
||||
@@ -53,8 +53,8 @@ abstract class Echomails extends Notification //implements ShouldQueue
|
||||
|
||||
$o->echoarea_id = $eo->id;
|
||||
|
||||
$o->datetime = Carbon::now();
|
||||
$o->tzoffset = $o->datetime->utcOffset();
|
||||
$o->datetime = Carbon::now()->utc();
|
||||
$o->tzoffset = Carbon::now()->utcOffset();
|
||||
|
||||
$o->flags = (Message::FLAG_LOCAL);
|
||||
|
||||
@@ -62,4 +62,13 @@ abstract class Echomails extends Notification //implements ShouldQueue
|
||||
|
||||
return $o;
|
||||
}
|
||||
|
||||
protected function sourceSummary(Echomail|Netmail $o,string $item=NULL): string
|
||||
{
|
||||
return sprintf("Your %s was received here on [%s] and it looks like you sent it on [%s].",
|
||||
$item ?: sprintf('%s with ID [%s] to [%s]',$o instanceof Netmail ? 'Netmail' : 'Echomail',$o->msgid,$o->to),
|
||||
Carbon::now()->utc()->toDateTimeString(),
|
||||
$o->date->utc()->toDateTimeString(),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user