Hi, With two timezones implied (source, and target). What is the more straightfoward way to achieve the following.
-
User inputs ‘date’ and ‘time’ attributes. (in the target timezone)
-
SearchModel validates those attributes according a given format (we want to know each of them is correctly formatted according to the target timezone)
-
SearchModel merges ‘date’ and ‘time’ to a ‘datetime’ attribute.
-
SearchModel formats ‘datetime’ to a source language (conversion due to timezone is implied). (validation is not needed).
-
SearchModel querys ‘datetime’ against db.
Issues:
-
At 3, for the merging, string concatenation is enough?
-
Where should 3 and 4 occur? at searchmodel::afterValidate() ? and with yii::$app->formater->asDatetime(); ?