@lighthouse/common 6.10.0-canary.0 → 6.10.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -27,7 +27,7 @@ function generateScheduleEnd({
|
|
|
27
27
|
// plus the interval length of the schedule frequency
|
|
28
28
|
// so that we can ensure that we are within a service interval
|
|
29
29
|
// MODIFIED FOR TESTING: Changed from 2 weeks to 1 hour for testing endless generation bug
|
|
30
|
-
const end = isFrequencyLessThanWeek ? mStart.add(
|
|
30
|
+
const end = isFrequencyLessThanWeek ? mStart.add(15, _scheduling.Unit.Minute).valueOf() : mStart.add(frequencyValue * 2, frequencyUnit).valueOf();
|
|
31
31
|
console.log('[generateScheduleEnd] START:', {
|
|
32
32
|
start: _momentTimezone.default.tz(start, timezone).format('YYYY-MM-DD HH:mm:ss Z'),
|
|
33
33
|
frequency: `${frequencyValue}${frequencyUnit}`,
|
|
@@ -17,7 +17,7 @@ export function generateScheduleEnd(_ref) {
|
|
|
17
17
|
// plus the interval length of the schedule frequency
|
|
18
18
|
// so that we can ensure that we are within a service interval
|
|
19
19
|
// MODIFIED FOR TESTING: Changed from 2 weeks to 1 hour for testing endless generation bug
|
|
20
|
-
var end = isFrequencyLessThanWeek ? mStart.add(
|
|
20
|
+
var end = isFrequencyLessThanWeek ? mStart.add(15, Unit.Minute).valueOf() : mStart.add(frequencyValue * 2, frequencyUnit).valueOf();
|
|
21
21
|
console.log('[generateScheduleEnd] START:', {
|
|
22
22
|
start: moment.tz(start, timezone).format('YYYY-MM-DD HH:mm:ss Z'),
|
|
23
23
|
frequency: "".concat(frequencyValue).concat(frequencyUnit),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateScheduleEnd.js","names":["includes","moment","Unit","generateScheduleEnd","_ref","frequency","start","timezone","frequencyUnit","unit","frequencyValue","value","isFrequencyLessThanWeek","Millisecond","Second","Minute","Hour","Day","mStart","tz","end","add","valueOf","console","log","format","concat","endTimestamp","durationFromStart","diff"],"sources":["../../../src/scheduling/helpers/generateScheduleEnd.ts"],"sourcesContent":["import { includes } from 'lodash/fp'\nimport moment from 'moment-timezone'\n\nimport { Period, Unit } from '../scheduling.types'\n\ninterface GenerateScheduleEnd {\n readonly frequency: Period\n readonly start: number\n readonly timezone: string\n}\n\n/**\n * Generates a schedule end datetime based on the start and frequency\n */\nexport function generateScheduleEnd({\n frequency,\n start,\n timezone,\n}: GenerateScheduleEnd): number {\n const { unit: frequencyUnit, value: frequencyValue } = frequency\n\n const isFrequencyLessThanWeek = includes(frequencyUnit, [\n Unit.Millisecond,\n Unit.Second,\n Unit.Minute,\n Unit.Hour,\n Unit.Day,\n ])\n\n const mStart = moment.tz(start, timezone)\n\n // NOTE: if frequency unit less than a week we must set end to jump a week\n // plus the interval length of the schedule frequency\n // so that we can ensure that we are within a service interval\n // MODIFIED FOR TESTING: Changed from 2 weeks to 1 hour for testing endless generation bug\n const end = isFrequencyLessThanWeek\n ? mStart.add(
|
|
1
|
+
{"version":3,"file":"generateScheduleEnd.js","names":["includes","moment","Unit","generateScheduleEnd","_ref","frequency","start","timezone","frequencyUnit","unit","frequencyValue","value","isFrequencyLessThanWeek","Millisecond","Second","Minute","Hour","Day","mStart","tz","end","add","valueOf","console","log","format","concat","endTimestamp","durationFromStart","diff"],"sources":["../../../src/scheduling/helpers/generateScheduleEnd.ts"],"sourcesContent":["import { includes } from 'lodash/fp'\nimport moment from 'moment-timezone'\n\nimport { Period, Unit } from '../scheduling.types'\n\ninterface GenerateScheduleEnd {\n readonly frequency: Period\n readonly start: number\n readonly timezone: string\n}\n\n/**\n * Generates a schedule end datetime based on the start and frequency\n */\nexport function generateScheduleEnd({\n frequency,\n start,\n timezone,\n}: GenerateScheduleEnd): number {\n const { unit: frequencyUnit, value: frequencyValue } = frequency\n\n const isFrequencyLessThanWeek = includes(frequencyUnit, [\n Unit.Millisecond,\n Unit.Second,\n Unit.Minute,\n Unit.Hour,\n Unit.Day,\n ])\n\n const mStart = moment.tz(start, timezone)\n\n // NOTE: if frequency unit less than a week we must set end to jump a week\n // plus the interval length of the schedule frequency\n // so that we can ensure that we are within a service interval\n // MODIFIED FOR TESTING: Changed from 2 weeks to 1 hour for testing endless generation bug\n const end = isFrequencyLessThanWeek\n ? mStart.add(15, Unit.Minute).valueOf()\n : mStart.add(frequencyValue * 2, frequencyUnit).valueOf()\n\n console.log('[generateScheduleEnd] START:', {\n start: moment.tz(start, timezone).format('YYYY-MM-DD HH:mm:ss Z'),\n frequency: `${frequencyValue}${frequencyUnit}`,\n isFrequencyLessThanWeek,\n timezone,\n })\n\n console.log('[generateScheduleEnd] END CALCULATED:', {\n end: moment.tz(end, timezone).format('YYYY-MM-DD HH:mm:ss Z'),\n endTimestamp: end,\n durationFromStart: `${moment(end).diff(moment(start), 'hours')} hours`,\n })\n\n return end\n}\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,WAAW;AACpC,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,SAAiBC,IAAI,QAAQ,qBAAqB;AAQlD;AACA;AACA;AACA,OAAO,SAASC,mBAAmBA,CAAAC,IAAA,EAIH;EAAA,IAH9BC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,KAAK,GAAAF,IAAA,CAALE,KAAK;IACLC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;EAER,IAAcC,aAAa,GAA4BH,SAAS,CAAxDI,IAAI;IAAwBC,cAAc,GAAKL,SAAS,CAAnCM,KAAK;EAElC,IAAMC,uBAAuB,GAAGZ,QAAQ,CAACQ,aAAa,EAAE,CACtDN,IAAI,CAACW,WAAW,EAChBX,IAAI,CAACY,MAAM,EACXZ,IAAI,CAACa,MAAM,EACXb,IAAI,CAACc,IAAI,EACTd,IAAI,CAACe,GAAG,CACT,CAAC;EAEF,IAAMC,MAAM,GAAGjB,MAAM,CAACkB,EAAE,CAACb,KAAK,EAAEC,QAAQ,CAAC;;EAEzC;EACA;EACA;EACA;EACA,IAAMa,GAAG,GAA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