public function registerJs($view, $settings = [])
    {
        if ($this->settings || $settings) {
            $settings = Json::htmlEncode(array_merge($this->settings, $settings));
            $view->registerJs("jQuery.extend(jQuery.timeago.settings, $settings);", $view::POS_READY, 'timeagoOptions');
        }

        $view->registerJs("jQuery('time.timeago').timeago();", $view::POS_READY, 'timeago');
    }
public function registerJs($view, $settings = [])
    {
        if ($this->settings || $settings) {
            $settings = Json::htmlEncode(array_merge($this->settings, $settings));
            $view->registerJs("jQuery.extend(jQuery.timeago.settings, $settings);", $view::POS_READY, 'timeagoOptions');
        }

        $view->registerJs("jQuery('time.timeago').timeago();", $view::POS_READY, 'timeago');
    }
public function registerJs ( $ view , $ settings = [ ] ) { if ( $ this -> settings || $ settings ) { $ settings = Json :: htmlEncode ( array_merge ( $ this -> settings , $ settings ) ) ; $ view -> registerJs ( "jQuery.extend(jQuery.timeago.settings, $settings);" , $ view :: POS_READY , 'timeagoOptions' ) ; } $ view -> registerJs ( "jQuery('time.timeago').timeago();" , $ view :: POS_READY , 'timeago' ) ; }
Registers timeago javascript.

@param \yii\web\View $view
@param array $settings
Registers timeago javascript .