amphtml icon indicating copy to clipboard operation
amphtml copied to clipboard

Intent to implement: Time ago component

Open bjalford opened this issue 9 years ago • 5 comments

We're (Bright Sites) keen to get involved in contributing to the AMP project. A component that would be useful for sites we work on (The Independent, Evening Standard) is one that displays a time and date as "time ago".

One option could be to implement the moment js script (https://momentjs.com/) It's slightly heavy in size. What are your views?

bjalford avatar Feb 06 '17 11:02 bjalford

cc @cramforce for feedback

rudygalfi avatar Feb 07 '17 00:02 rudygalfi

So, …, I think that this would be great in general. We have largely avoided i18n baked into AMP components, so it would be not completely clear how that would be done here.

Moment.js would definitely be a pretty big gun for this specialized use case. What does it weigh in at?

cramforce avatar Feb 07 '17 01:02 cramforce

Just over 20k - 60k with locales. We think that we will do something custom that fits the exact use case.

bjalford avatar Feb 07 '17 12:02 bjalford

SG @bjalford how do you handle i18n?

cramforce avatar Feb 07 '17 16:02 cramforce

This has now been committed to master.

bjalford avatar May 04 '17 06:05 bjalford