コード例 #1
0
ファイル: coming-soon.blade.php プロジェクト: livecms/core
                //     'year': 2015,
                //     'hour': 0,
                //     'min': 0,
                //     'sec': 0
                // },
                // omitWeeks: true

                <?php 
$launchingDateTime = !empty($global_params['launching_datetime']) ? $global_params['launching_datetime'] : '2017-01-01 00:00:00';
$datetime = new Carbon\Carbon($launchingDateTime);
$sec = $datetime->diffInSeconds() % 60;
$min = $datetime->diffInMinutes() % 60;
$hour = $datetime->diffInHours() % 24;
$day = $datetime->diffInDays() % 30;
$month = $datetime->diffInMonths() % 12;
$year = $datetime->diffInYears();
?>

                 targetOffset: {
                    'day':      {{ $day }},
                    'month':    {{ $month }},
                    'year':     {{ $year }},
                    'hour':     {{ $hour }},
                    'min':      {{ $min }},
                    'sec':      {{ $sec }}
                },
                omitWeeks: true

                });
            })
        </script>