G
G
gleendo2017-07-20 22:03:13
PHP
gleendo, 2017-07-20 22:03:13

Why, if you use templating, then the logic starts to work not as it should?

Tell me what could be the problem... If you do not use templating, but simply compose the elements of the image list, then everything works fine, but if you use a templating engine, it does not work as it should, for some reason the shift coordinates are calculated in the opposite direction.
Working version without templating - https://codepen.io/evg_/pen/JJgpOB?editors=1010
Non-working version with templating - https://codepen.io/evg_/pen/dWvEdq?editors=1010

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vitaliy Orlov, 2019-02-05
@sidiqi

echo 'Timestamp: '.strtotime('2019-02-06T18:00:00+03:00');
echo 'Текущий timestamp: '.time();
echo 'Разница, секунд: '. (time() - strtotime('2019-02-06T18:00:00+03:00'));

timestamp = time in seconds elapsed since Jan 1, 1970

D
Dmitry Bay, 2019-02-05
@kawabanga

DateTime
php.net/manual/ru/class.datetime.php
and it has an interval function
php.net/manual/ru/class.dateinterval.php

$d1=new DateTime("2012-07-08 11:14:15.638276");
$d2=new DateTime("2012-07-08 11:14:15.889342");
$diff=$d2->diff($d1);
print_r($diff);

L
Larisa Moroz, 2017-07-21
@evgeniy8705

Check the value of the listItems property, which is set before initialization and participates in the calculations.
Corrected version: https://codepen.io/lmoroz/pen/MoNBZZ?editors=1011#0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question