snippets-service icon indicating copy to clipboard operation
snippets-service copied to clipboard

JEXL targeting: Local Time Publish Start and Publish End

Open glogiotatidis opened this issue 7 years ago • 12 comments
trafficstars

Marked stretch goal since this something we don't currently have. We do publish start / end on the server side using UTC timestamps.

glogiotatidis avatar Aug 22 '18 11:08 glogiotatidis

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 avatar Nov 14 '18 08:11 glogiotatidis

@glogiotatidis set a reminder for Nov 28th 2018

reminders[bot] avatar Nov 14 '18 08:11 reminders[bot]

:wave: @glogiotatidis, discuss with the LCM team

reminders[bot] avatar Nov 28 '18 09:11 reminders[bot]

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.

jkt230 avatar Dec 12 '18 22:12 jkt230

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.

glogiotatidis avatar Dec 13 '18 09:12 glogiotatidis

Maybe useful docs: https://firefox-source-docs.mozilla.org/browser/components/newtab/docs/

glogiotatidis avatar May 22 '19 12:05 glogiotatidis

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)

glogiotatidis avatar May 22 '19 12:05 glogiotatidis

We didn't hit Fx71, removing from milestone

glogiotatidis avatar Oct 14 '19 10:10 glogiotatidis

Talked with Andrei from AS and we agree that both teams want this. I expect some movement soon.

/remind me in 2 weeks

glogiotatidis avatar Nov 19 '19 14:11 glogiotatidis

@glogiotatidis set a reminder for Dec 3rd 2019

reminders[bot] avatar Nov 19 '19 14:11 reminders[bot]

:wave: @glogiotatidis,

reminders[bot] avatar Dec 03 '19 09:12 reminders[bot]

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.

glogiotatidis avatar Dec 03 '19 12:12 glogiotatidis