GithubHelp home page GithubHelp logo

yiidoc / yii2-timeago Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 14.0 11 KB

Timeago is a jQuery plugin that makes it easy to support automatically updating fuzzy timestamps. Forked from @rmm5t for Yii2 framework

License: BSD 3-Clause "New" or "Revised" License

PHP 100.00%

yii2-timeago's People

Contributors

binggrae avatar yakovlev-vladimir avatar zinzinday avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

yii2-timeago's Issues

minify asset

2016-11-25 15:50:55 [*.*.*.*][1][aeu9jti95cfp0l9rh05agndtm5][error][yii\base\InvalidConfigException] exception 'yii\base\InvalidConfigException' with message 'Language 'en' do not exist.' in /www/www/public/vendor/yiidoc/yii2-timeago/TimeAgo.php:58
Stack trace:
#0 /www/www/public/vendor/yiidoc/yii2-timeago/TimeAgo.php(49): yii\timeago\TimeAgo->registerLocale()
#1 /www/www/public/vendor/yiisoft/yii2/base/Object.php(107): yii\timeago\TimeAgo->init()
#2 [internal function]: yii\base\Object->__construct(Array)
#3 /www/www/public/vendor/yiisoft/yii2/di/Container.php(373): ReflectionClass->newInstanceArgs(Array)
#4 /www/www/public/vendor/yiisoft/yii2/di/Container.php(154): yii\di\Container->build('yii\\timeago\\Tim...', Array, Array)
#5 /www/www/public/vendor/yiisoft/yii2/BaseYii.php(344): yii\di\Container->get('yii\\timeago\\Tim...', Array, Array)
#6 /www/www/public/vendor/yiisoft/yii2/base/Widget.php(101): yii\BaseYii::createObject(Array)
#7 /www/www/public/vendor/yeesoft/yii2-comments/widgets/views/comments.php(55): yii\base\Widget::widget()
#8 /www/www/public/vendor/yiisoft/yii2/base/View.php(326): require('/www/www/pub...')
#9 /www/www/public/vendor/yiisoft/yii2/base/View.php(248): yii\base\View->renderPhpFile('/www/www/pub...', Array)
#10 /www/www/public/vendor/yiisoft/yii2/base/View.php(150): yii\base\View->renderFile('/www/www/pub...', Array, Object(yeesoft\comments\widgets\Comments))
#11 /www/www/public/vendor/yiisoft/yii2/base/Widget.php(195): yii\base\View->render('comments', Array, Object(yeesoft\comments\widgets\Comments))
#12 /www/www/public/vendor/yeesoft/yii2-comments/widgets/Comments.php(76): yii\base\Widget->render('comments', Array)
#13 /www/www/public/vendor/yiisoft/yii2/base/Widget.php(102): yeesoft\comments\widgets\Comments->run()
#14 /www/www/public/views/film/view.php(119): yii\base\Widget::widget(Array)
#15 /www/www/public/vendor/yiisoft/yii2/base/View.php(326): require('/www/www/pub...')
#16 /www/www/public/vendor/yiisoft/yii2/base/View.php(248): yii\base\View->renderPhpFile('/www/www/pub...', Array)
#17 /www/www/public/vendor/yiisoft/yii2/base/View.php(150): yii\base\View->renderFile('/www/www/pub...', Array, Object(app\controllers\FilmController))
#18 /www/www/public/vendor/yiisoft/yii2/base/Controller.php(378): yii\base\View->render('view', Array, Object(app\controllers\FilmController))
#19 /www/www/public/controllers/FilmController.php(178): yii\base\Controller->render('view', Array)
#20 [internal function]: app\controllers\FilmController->actionView('217')
#21 /www/www/public/vendor/yiisoft/yii2/base/InlineAction.php(55): call_user_func_array(Array, Array)
#22 /www/www/public/vendor/yiisoft/yii2/base/Controller.php(154): yii\base\InlineAction->runWithParams(Array)
#23 /www/www/public/vendor/yiisoft/yii2/base/Module.php(454): yii\base\Controller->runAction('view', Array)
#24 /www/www/public/vendor/yiisoft/yii2/web/Application.php(100): yii\base\Module->runAction('film/view', Array)
#25 /www/www/public/vendor/yiisoft/yii2/base/Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#26 /www/www/public/web/index.php(18): yii\base\Application->run()
#27 {main}

error in function:

    protected function registerLocale()
    {
        if (file_exists(Yii::getAlias($this->getAssetBundle()->sourcePath) . DIRECTORY_SEPARATOR . "locales" . DIRECTORY_SEPARATOR . "jquery.timeago.{$this->language}.js")) {
            $this->getAssetBundle()->js[] = "locales/jquery.timeago.{$this->language}.js";
        } else {
            throw new InvalidConfigException("Language '{$this->language}' do not exist.");
        }
    }

Traslation

There is support for other languages?

Load default language if locale is not found

if (file_exists(Yii::getAlias($this->getAssetBundle()->sourcePath) . DIRECTORY_SEPARATOR . "locales" . DIRECTORY_SEPARATOR . "jquery.timeago.{$this->language}.js")) {

IMHO, Instead of throwing exception , wouldn't it be better to load default language, or just show unformatted date time, if the language locale is not found ?

Time ago Timezone issue

It always shows some time different in hrs when hosted on different servers.
Any hep pls ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.