Fields editable for a particular duration

During writing my code I got a requirement to make a field editable only for a particular duration.
For example, I made a field and my requirement is to make this field to be editable for a starting date 15/01/2021 to ending date 01/02/2021.
Any reference to resolve this issue coming will be highly appreciable!!!

That sounds like a strange requirement. Normally we make a field readonly based on some other fields of the model.

Could you share more details about this requirement? This way we may be able to propose a better solution.

You can set the readonly based on a function field that returns if the current date is between your proposed range. Then you can set the readonly attribute of your field depend on this new function field.