Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Helpers didnt work. #20

Closed
maxpain opened this issue Apr 4, 2014 · 2 comments
Closed

Helpers didnt work. #20

maxpain opened this issue Apr 4, 2014 · 2 comments

Comments

@maxpain
Copy link

maxpain commented Apr 4, 2014

When I try call helper, it causes an error.

Your app is crashing. Here's the latest log.
=> Errors prevented startup:
While building the application:
packages/html-tools/scanner.js:45: Expected identifier, number, string, boolean, or null
{{getTime(date)}}
     ^ (compiling client/views/blocks/chat/chat.jade.html)
UI.registerHelper('getTime', function(time) {
    return time ? moment(time).format('L / HH:mm') : null;
});
each messages
    p
        a(href='/users/#{username}')
            strong.text-info #{username}
                | :  
                =message
            p.text-right.text-muted= getTime(date)
@mquandalle
Copy link
Owner

The problem comes from the getTime(date) and this is a known limitation. (See for instance #9). This will be fixed at some point.

As a temporary solution you can use:

p.text-right.text-muted {{getTime date}}

@maxpain
Copy link
Author

maxpain commented Apr 4, 2014

Thank you :)

@mquandalle mquandalle added this to the v0.3 milestone Apr 4, 2014
@mquandalle mquandalle removed this from the v0.3 milestone Apr 4, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants