Skip to content

Issue with "on change" #45

@KrunchMuffin

Description

@KrunchMuffin

Everything works as it should until I implement the listener.

$('#Timestamp').on('change.livestamp', function(event, from, to) {
            event.preventDefault(); // Stop the text from changing automatically
            console.log(from,to);
            if(to.indexOf("ago")){
                $(this).removeClass("label-success label-warning").addClass("label-danger").html(to);
            } else {
                $(this).html(to);
            }
        }).livestamp();

It goes from saying 3 hours ago to saying a few seconds ago on load. Like it's just using the current time instead of the data attribute time provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions