Просмотр исходного кода

Extended valid UTC offset range from -12 to +14 (#250)

According to Wikipedia, this should cover the entire globe.
Fixes #249
Alexander Kopachov 10 месяцев назад
Родитель
Сommit
46f0a10a26
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      cli/plugins/timezone/timezone.c
  2. 2 2
      ui/scenes/app_settings/totp_app_settings.c

+ 2 - 2
cli/plugins/timezone/timezone.c

@@ -17,7 +17,7 @@ static void handle(PluginState* plugin_state, FuriString* args, Cli* cli) {
     if(args_read_string_and_trim(args, temp_str)) {
         char* strtof_endptr;
         float tz = strtof(furi_string_get_cstr(temp_str), &strtof_endptr);
-        if(*strtof_endptr == 0 && tz >= -12.75f && tz <= 12.75f) {
+        if(*strtof_endptr == 0 && tz >= -12.75f && tz <= 14.75f) {
             TOTP_CLI_LOCK_UI(plugin_state);
             plugin_state->timezone_offset = tz;
             if(totp_config_file_update_timezone_offset(plugin_state)) {
@@ -46,4 +46,4 @@ static const FlipperAppPluginDescriptor plugin_descriptor = {
 
 const FlipperAppPluginDescriptor* totp_cli_timezone_plugin_ep() {
     return &plugin_descriptor;
-}
+}

+ 2 - 2
ui/scenes/app_settings/totp_app_settings.c

@@ -368,7 +368,7 @@ bool totp_scene_app_settings_handle_event(
         case InputKeyRight:
             if(scene_state->selected_control == HoursInput) {
                 totp_roll_value_int8_t(
-                    &scene_state->tz_offset_hours, 1, -12, 12, RollOverflowBehaviorStop);
+                    &scene_state->tz_offset_hours, 1, -12, 14, RollOverflowBehaviorStop);
             } else if(scene_state->selected_control == MinutesInput) {
                 totp_roll_value_uint8_t(
                     &scene_state->tz_offset_minutes, 15, 0, 45, RollOverflowBehaviorRoll);
@@ -419,7 +419,7 @@ bool totp_scene_app_settings_handle_event(
         case InputKeyLeft:
             if(scene_state->selected_control == HoursInput) {
                 totp_roll_value_int8_t(
-                    &scene_state->tz_offset_hours, -1, -12, 12, RollOverflowBehaviorStop);
+                    &scene_state->tz_offset_hours, -1, -12, 14, RollOverflowBehaviorStop);
             } else if(scene_state->selected_control == MinutesInput) {
                 totp_roll_value_uint8_t(
                     &scene_state->tz_offset_minutes, -15, 0, 45, RollOverflowBehaviorRoll);