Read the statement by Michael Teeuw here.
MMM-CustomElementTime
-
@mmrize angular has had support for custom tags for a long time.
-
@sdetweil right. Anyway we will not rewrite mm with angular or vue. :) (I prefer vue)
-
@mmrize if you’re talking about time you can just do that with straight ol vanilla js …
var DateDiff = { inDays: function(d1, d2) { var t2 = d2.getTime(); var t1 = d1.getTime(); return parseInt((t2 - t1) / (24 * 3600 * 1000)); }, }
I use that in my upcoming Holiday module to get days left until a particular holiday
If you’re looking for days left kind of thing. I know you can do this for other time variables such as minutes, seconds, etc.
-
@cowboysdude he is proposing a new html tag that will produce the content in a consistent way with the new time apis(not moment), so only have to write it once, and everybody benefits
-
@cowboysdude
Yup, Every developer can implement his own logic to display time-related stuff. And hundreds of MM modules are there, so hundreds of implementations are existing also, just to display “in 15 days”.
I think it is a kind of waste. So I propose a reusable common HTML tag anyone can use anywhere.But the most benefit of this custom tag is, in my thought, Customizability and Locale-awareness separated from the module itself. Logic-neutral HTML tag could give the ability of easier user-customization without the developer’s effort. That is the purpose of this custom tag.