mirror of
https://github.com/grocy/grocy.git
synced 2026-04-09 14:06:16 +02:00
Add Date
This commit is contained in:
parent
2088e4be5b
commit
c58620f898
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace Grocy\Services;
|
namespace Grocy\Services;
|
||||||
|
|
||||||
|
use DateTime;
|
||||||
use Exception;
|
use Exception;
|
||||||
use Mike42\Escpos\PrintConnectors\NetworkPrintConnector;
|
use Mike42\Escpos\PrintConnectors\NetworkPrintConnector;
|
||||||
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
|
use Mike42\Escpos\PrintConnectors\FilePrintConnector;
|
||||||
|
|
@ -33,6 +34,9 @@ class PrintService extends BaseService
|
||||||
*/
|
*/
|
||||||
private static function printHeader(Printer $printer)
|
private static function printHeader(Printer $printer)
|
||||||
{
|
{
|
||||||
|
$date = new DateTime();
|
||||||
|
$dateFormatted = $date->format('d/m/Y H:i');
|
||||||
|
|
||||||
$printer->setJustification(Printer::JUSTIFY_CENTER);
|
$printer->setJustification(Printer::JUSTIFY_CENTER);
|
||||||
$printer->selectPrintMode(Printer::MODE_DOUBLE_WIDTH);
|
$printer->selectPrintMode(Printer::MODE_DOUBLE_WIDTH);
|
||||||
$printer->setTextSize(4, 4);
|
$printer->setTextSize(4, 4);
|
||||||
|
|
@ -41,8 +45,11 @@ class PrintService extends BaseService
|
||||||
$printer->setJustification();
|
$printer->setJustification();
|
||||||
$printer->setTextSize(1, 1);
|
$printer->setTextSize(1, 1);
|
||||||
$printer->setReverseColors(false);
|
$printer->setReverseColors(false);
|
||||||
|
$printer->feed(2);
|
||||||
|
$printer->text($dateFormatted);
|
||||||
$printer->selectPrintMode();
|
$printer->selectPrintMode();
|
||||||
$printer->feed(3);
|
$printer->feed(3);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user