mirror of
https://framagit.org/tom79/fediplan.git
synced 2025-04-06 06:01:50 +02:00
Fix some issues with date
This commit is contained in:
parent
f1ab597934
commit
fb09ea8d78
3 changed files with 4 additions and 5 deletions
|
@ -16,7 +16,6 @@ use App\SocialEntity\Compose;
|
||||||
use App\SocialEntity\MastodonAccount;
|
use App\SocialEntity\MastodonAccount;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
use DateTimeZone;
|
use DateTimeZone;
|
||||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Form\FormError;
|
use Symfony\Component\Form\FormError;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
@ -195,9 +194,9 @@ class FediPlanController extends AbstractController
|
||||||
$params['sensitive'] = ($data->getSensitive() == null || !$data->getSensitive())?false:true;
|
$params['sensitive'] = ($data->getSensitive() == null || !$data->getSensitive())?false:true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$date = new DateTime( $data->getScheduledAt()->format("Y-m-d H:i:s"), new DateTimeZone($data->getTimeZone()) );
|
$date = new DateTime( $data->getScheduledAt()->format("Y-m-d H:i"), new DateTimeZone($data->getTimeZone()) );
|
||||||
$date->setTimezone( new DateTimeZone("UTC"));
|
$date->setTimezone( new DateTimeZone("UTC"));
|
||||||
$params['scheduled_at'] = $date->format('c');
|
$params['scheduled_at'] = $date->format(DateTime::ISO8601);
|
||||||
} catch (\Exception $e) {}
|
} catch (\Exception $e) {}
|
||||||
try {
|
try {
|
||||||
$response = $mastodon_api->post_statuses($params);
|
$response = $mastodon_api->post_statuses($params);
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
{% elseif status.visibility == "direct" %}
|
{% elseif status.visibility == "direct" %}
|
||||||
<i class="fa fa-envelope"></i>
|
<i class="fa fa-envelope"></i>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</small> - {{ status.scheduledAt | date('d/m/y H:m') }}
|
</small> - {{ status.scheduledAt | date('d/m/y H:i') }}
|
||||||
<button class="btn btn-danger small" data-record-id="{{ status.getId() }}" style="position: absolute;right: 5px;bottom: 5px;"
|
<button class="btn btn-danger small" data-record-id="{{ status.getId() }}" style="position: absolute;right: 5px;bottom: 5px;"
|
||||||
|
|
||||||
data-record-title="{{ status.content }} - {{ status.scheduledAt | date('d/m/y H:m') }}"
|
data-record-title="{{ status.content }} - {{ status.scheduledAt | date('d/m/y H:m') }}"
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{ form_start(form) }}
|
{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }}
|
||||||
<div class="row" style="margin-top: 30px;">
|
<div class="row" style="margin-top: 30px;">
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
Loading…
Add table
Reference in a new issue