snippets-service
snippets-service copied to clipboard
JEXL targeting: Local Time Publish Start and Publish End
Marked stretch goal since this something we don't currently have. We do publish start / end on the server side using UTC timestamps.
We need to decide whether we want to continue doing the time filtering on the server, or switch to the client or somehow combine both.
/remind me to discuss with the LCM team in 2 weeks
@glogiotatidis set a reminder for Nov 28th 2018
:wave: @glogiotatidis, discuss with the LCM team
I know we discussed this, can you remind me where we landed? - Sorry I searched the notes and I don't think a decision was made.
We agreed that we want to have the option of precise date-time targeting on the client side.
I filed bug 1513819 for the AS team to provide us what we need.
When that's available we can discuss options on how we want this to work and if we want to completelly replace the current publish_start and publish_end mechanism with this one.
Maybe useful docs: https://firefox-source-docs.mozilla.org/browser/components/newtab/docs/
DXR:
- https://dxr.mozilla.org/mozilla-central/source/browser/components/newtab/lib/ASRouterTargeting.jsm#194
- tests https://dxr.mozilla.org/mozilla-central/source/browser/components/newtab/lib/ASRouterTargeting.jsm#194
New code something like:
var d = new Date();
d = new Date(d.getTime() - d.getTimezoneOffset() * 60000)
We probably want to also have an attribute for time only, so we can target specific times in a day (e.g. show before noon, or between 18:00 and 21:00)
We didn't hit Fx71, removing from milestone
Talked with Andrei from AS and we agree that both teams want this. I expect some movement soon.
/remind me in 2 weeks
@glogiotatidis set a reminder for Dec 3rd 2019
:wave: @glogiotatidis,
It seems we can use currentDate in this form
"2019-12-03T12:30:00" |date < currentDate|date &&
currentDate|date < "2019-12-03T15:30:00" |date
This example evaluates to true only between 12:30 and 15:30 local time. Note that the dates don't have an ending Z, making them local times.
No further changes are needed AS for this to work.