Time range not working properly in InfluxDB tasks

I am writing the InfluDB task to do some operation for the last one-hour duration.

option task = {name: "temp_task", every: 1h, offset: 17m}

f = (a, b) =>
    (from(bucket: a)
        |> range(start: -77m)
        |> filter(fn: (r) =>
            (r["_measurement"] == input_measurement))
        |> filter(fn: (r) =>
            (r["_field"] == "fieldname"))
        |> spread()
        |> map(fn: (r) =>
            ({r with time: r._stop, _measurement: output_measurement, _field: "fieldname"}))
        |> to(bucket: b, org: "org_name", timeColumn: "time"))
f(a: input_bucket, b: output_bucket)

I am using the spread() function here to calculate the difference between the minimum and maximum value for the specified interval time
The data is coming in my measurement after 15 mins interval like below:
00:00
00:15
00:30
00:45
01:00 and so on
I have given 17 mins offset in the task because my data is coming late. according to the task it calculates the difference between the 01:45 and 00:45 but I want to calculate the difference between 01:00 and 00:00
it doesn’t matter if I pass |> range(start: -77m) or |> range(start: -60m) it always start difference from xx:45 timestamp.

I have put -77m because I want to cover timestamp xx:00 to xx:00 and 17 mins of offset.

The same query is working fine if running as a normal query then it taking -77 mins properly.

is there any way I can achieve taking the difference from xx:00 to xx:00 instead of xx:45 to xx:45 like 02:00 and 01:00 instead of 01:45 and 00:45?