before i write a udf, does anyone know of a udf th...
# cfml-general
b
before i write a udf, does anyone know of a udf that will display a datediff in a format such as 1 week ago, 2 weeks ago, 1 month ago, 1year ago, etc.?
a
MomentCFC has a function that shows relative time. https://github.com/AlumnIQ/momentcfc
👍 2
e
b
thanks! i'm checking them both out now
@adam.euans that module worked perfectly, thanks! I wish it could be used without having to init a new component each time, a quick refactor could possibly solve this. but works as it should, thanks!
👍🏻 1
d
@adam.euans I looked at the basic Moment.cfc docs page a while ago, didn't see anything I recognized as returning relative time (2 hours ago...). What's the method name?
a
from() or fromNow()
d
Ah thanks, the magic word is "fuzzy" 🙂
r
first where I usually check for UDF is in the galaxy far far away 🙂