Trying to get a temporal controller with a Slider

Sorry, I’m not a programmer — just a user with the help of AI.

The way we get the QGIS temporal controller in QField is through a time range, as shown in the images below:

image|520x339, 50%

So I created this slider as a plugin that doesn’t really do anything yet — it just helps visualize the idea. If it could actually change the end range of the Temporal Properties (not sure what the correct term is in English), that would be amazingly useful.

slider|690x392, 75%

This is the main.qml I came up with (with help from ChatGPT):

import QtQuick 2.15
import QtQuick.Controls 2.15
import org.qfield 1.0
import Theme 1.0

Item {
    id: plugin
    width: 0; height: 0
    property var mainWindow: iface.mainWindow()

    Component.onCompleted: {
        iface.addItemToPluginsToolbar(sliderBar)
    }

    Item {
        id: sliderBar
        width: mainWindow.width
        height: 50

        Rectangle {
            anchors.fill: parent
            color: Theme.darkGraySemiOpaque

            // Slider centralizado
            Slider {
                id: slider
                anchors.verticalCenter: parent.verticalCenter
                anchors.horizontalCenter: parent.horizontalCenter
                width: parent.width * 0.8
                from: 0
                to: 365
                value: 365

                onValueChanged: {
                    // calcula nova data final baseada em 2025-01-01 + valor
                    var baseDate = new Date(2025, 0, 1, 0, 0, 0)
                    baseDate.setDate(baseDate.getDate() + Math.round(value))
                    var yyyy = baseDate.getFullYear()
                    var mm = ('0' + (baseDate.getMonth() + 1)).slice(-2)
                    var dd = ('0' + baseDate.getDate()).slice(-2)
                    var dateStr = yyyy + '-' + mm + '-' + dd + ' 00:00:00'

                    mainWindow.displayToast(qsTr("Nova data final: " + dateStr))

                    // Aqui seria o ponto para tentar alterar a propriedade temporal
                    // MAS o QField não expõe isso via QML no momento
                    // Se um dia expuser algo como iface.setTemporalEnd(dateStr), faça aqui
                }
            }
        }
    }
}

Any ideas or suggestions on how to get this working?

Thanks!