Changes in / [74b92e6:1cea9c0] in mainline
- Files:
-
- 5 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
.gitignore
r74b92e6 r1cea9c0 9 9 tools/xcw/demo/viewer 10 10 /.cache 11 /PKG 12 /downloads 13 /amd64-helenos 14 .cursorignore -
uspace/app/aboutos/aboutos.c
r74b92e6 r1cea9c0 167 167 ui_wnd_params_init(¶ms); 168 168 params.caption = "About HelenOS"; 169 params.placement = ui_wnd_place_center; 169 170 170 171 /* FIXME: Auto layout */ -
uspace/app/date/date.c
r74b92e6 r1cea9c0 1 1 /* 2 * Copyright (c) 2025 Wayne Michael Thornton (WMT) <wmthornton-dev@outlook.com> 2 3 * Copyright (c) 2012 Maurizio Lombardi 3 4 * All rights reserved. … … 195 196 196 197 /** Read the day, month and year from a string 197 * with the following format: DD/MM/YYYY 198 * with the following format: DD/MM/YYYY or MM/DD/YYYY 198 199 */ 199 200 static errno_t … … 202 203 errno_t rc; 203 204 uint32_t tmp; 205 uint32_t first_num; 206 uint32_t second_num; 204 207 205 208 if (str_size(wdate) != 10) /* str_size("DD/MM/YYYY") == 10 */ … … 211 214 } 212 215 213 rc = str_uint32_t(&wdate[0], NULL, 10, false, &tmp); 214 if (rc != EOK) 215 return rc; 216 217 t->tm_mday = tmp; 218 219 rc = str_uint32_t(&wdate[3], NULL, 10, false, &tmp); 220 if (rc != EOK) 221 return rc; 222 223 t->tm_mon = tmp - 1; 216 /* Parse first number */ 217 rc = str_uint32_t(&wdate[0], NULL, 10, false, &first_num); 218 if (rc != EOK) 219 return rc; 220 221 /* Parse second number */ 222 rc = str_uint32_t(&wdate[3], NULL, 10, false, &second_num); 223 if (rc != EOK) 224 return rc; 225 226 /* Determine format based on first number */ 227 if (first_num > 12) { 228 /* First number is day (DD/MM/YYYY format) */ 229 t->tm_mday = first_num; 230 t->tm_mon = second_num - 1; 231 } else if (second_num > 12) { 232 /* Second number is day (MM/DD/YYYY format) */ 233 t->tm_mon = first_num - 1; 234 t->tm_mday = second_num; 235 } else { 236 /* Ambiguous case - assume DD/MM/YYYY format */ 237 t->tm_mday = first_num; 238 t->tm_mon = second_num - 1; 239 } 224 240 225 241 rc = str_uint32_t(&wdate[6], NULL, 10, false, &tmp); 242 if (rc != EOK) 243 return rc; 244 226 245 t->tm_year = tmp - 1900; 227 246 228 return rc;247 return EOK; 229 248 } 230 249 … … 331 350 usage(void) 332 351 { 333 printf("Usage: date [-d DD/MM/YYYY ] [-t HH:MM[:SS]]\n");334 printf(" -d Change the current date \n");352 printf("Usage: date [-d DD/MM/YYYY|MM/DD/YYYY] [-t HH:MM[:SS]]\n"); 353 printf(" -d Change the current date (supports both DD/MM/YYYY and MM/DD/YYYY formats)\n"); 335 354 printf(" -t Change the current time\n"); 336 355 printf(" -h Display this information\n"); -
uspace/app/meson.build
r74b92e6 r1cea9c0 37 37 'cpptest', 38 38 'date', 39 'date_cfg', 39 40 'devctl', 40 41 'df', -
uspace/app/taskbar/clock.c
r74b92e6 r1cea9c0 219 219 } 220 220 221 /** Launch date configuration application */ 222 static errno_t taskbar_clock_launch_date_cfg(void) 223 { 224 task_id_t id; 225 const char *args[] = { "/app/date_cfg", NULL }; 226 return task_spawnv(&id, NULL, args[0], args); 227 } 228 221 229 /** Handle taskbar clock position event. 222 230 * … … 233 241 if (!gfx_pix_inside_rect(&pos, &clock->rect)) 234 242 return ui_unclaimed; 243 244 if (event->type == POS_PRESS) { 245 taskbar_clock_launch_date_cfg(); 246 } 235 247 236 248 return ui_claimed;
Note:
See TracChangeset
for help on using the changeset viewer.