Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed number of seconds in a day #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ cdef public class Calendar(LayoutClass) [object PyElementaryCalendar, type PyEle
struct tm selected_time;
time_t current_time;

current_time = time(NULL) + 5 84600;
current_time = time(NULL) + 5 86400;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "holiday", selected_time,
ELM_CALENDAR_ANNUALLY);

current_time = time(NULL) + 1 84600;
current_time = time(NULL) + 1 86400;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "checked", selected_time, ELM_CALENDAR_UNIQUE);

Expand Down
16 changes: 8 additions & 8 deletions BINDINGS/python/python-elementary/tests/test_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ def test_calendar2(obj):
cal3 = elm_calendar_add(win)
evas_object_size_hint_weight_set(cal3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
evas_object_size_hint_align_set(cal3, EVAS_HINT_FILL, EVAS_HINT_FILL)
current_time = time(NULL) + 34 * 84600
current_time = time(NULL) + 34 * 86400
localtime_r(&current_time, &selected_time)
elm_calendar_selected_time_set(cal3, &selected_time)
current_time = time(NULL) + 1 * 84600
current_time = time(NULL) + 1 * 86400
localtime_r(&current_time, &selected_time)
elm_calendar_mark_add(cal3, "checked", &selected_time, ELM_CALENDAR_UNIQUE)
elm_calendar_marks_clear(cal3)
Expand Down Expand Up @@ -215,24 +215,24 @@ def test_calendar2(obj):
elm_calendar_format_function_set(cal, _format_month_year)
elm_calendar_min_max_year_set(cal, 2010, 2020)

current_time = time(NULL) + 4 * 84600
current_time = time(NULL) + 4 * 86400
localtime_r(&current_time, &selected_time)
elm_calendar_mark_add(cal, "holiday", &selected_time, ELM_CALENDAR_ANNUALLY)

current_time = time(NULL) + 1 * 84600
current_time = time(NULL) + 1 * 86400
localtime_r(&current_time, &selected_time)
elm_calendar_mark_add(cal, "checked", &selected_time, ELM_CALENDAR_UNIQUE)

current_time = time(NULL) - 363 * 84600
current_time = time(NULL) - 363 * 86400
localtime_r(&current_time, &selected_time)
elm_calendar_mark_add(cal, "checked", &selected_time, ELM_CALENDAR_MONTHLY)

current_time = time(NULL) - 5 * 84600
current_time = time(NULL) - 5 * 86400
localtime_r(&current_time, &selected_time)
mark = elm_calendar_mark_add(cal, "holiday", &selected_time,
ELM_CALENDAR_WEEKLY)

current_time = time(NULL) + 1 * 84600
current_time = time(NULL) + 1 * 86400
localtime_r(&current_time, &selected_time)
elm_calendar_mark_add(cal, "holiday", &selected_time, ELM_CALENDAR_WEEKLY)

Expand All @@ -258,7 +258,7 @@ def test_calendar3(obj):
cal = elm_calendar_add(win)
elm_calendar_first_day_of_week_set(cal, ELM_DAY_THURSDAY)
elm_calendar_select_mode_set(cal, ELM_CALENDAR_SELECT_MODE_ONDEMAND)
current_time = time(NULL) + 34 * 84600
current_time = time(NULL) + 34 * 86400
localtime_r(&current_time, &selected_time)
elm_calendar_selected_time_set(cal, &selected_time)
evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND)
Expand Down
16 changes: 8 additions & 8 deletions elementary/src/bin/test_calendar.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ test_calendar2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
cal3 = elm_calendar_add(win);
evas_object_size_hint_weight_set(cal3, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(cal3, EVAS_HINT_FILL, EVAS_HINT_FILL);
current_time = time(NULL) + 34 * 84600;
current_time = time(NULL) + 34 * 86400;
localtime_r(&current_time, &selected_time);
elm_calendar_selected_time_set(cal3, &selected_time);
current_time = time(NULL) + 1 * 84600;
current_time = time(NULL) + 1 * 86400;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal3, "checked", &selected_time, ELM_CALENDAR_UNIQUE);
elm_calendar_marks_clear(cal3);
Expand Down Expand Up @@ -299,24 +299,24 @@ test_calendar2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
elm_calendar_format_function_set(cal, _format_month_year);
elm_calendar_min_max_year_set(cal, 2010, 2020);

current_time = time(NULL) + 4 * 84600;
current_time = time(NULL) + 4 * 86400;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "holiday", &selected_time, ELM_CALENDAR_ANNUALLY);

current_time = time(NULL) + 1 * 84600;
current_time = time(NULL) + 1 * 86400;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "checked", &selected_time, ELM_CALENDAR_UNIQUE);

current_time = time(NULL) - 363 * 84600;
current_time = time(NULL) - 363 * 86400;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "checked", &selected_time, ELM_CALENDAR_MONTHLY);

current_time = time(NULL) - 5 * 84600;
current_time = time(NULL) - 5 * 86400;
localtime_r(&current_time, &selected_time);
mark = elm_calendar_mark_add(cal, "holiday", &selected_time,
ELM_CALENDAR_WEEKLY);

current_time = time(NULL) + 1 * 84600;
current_time = time(NULL) + 1 * 86400;
localtime_r(&current_time, &selected_time);
elm_calendar_mark_add(cal, "holiday", &selected_time, ELM_CALENDAR_WEEKLY);

Expand Down Expand Up @@ -356,7 +356,7 @@ test_calendar3(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
elm_calendar_selectable_set(cal,
(ELM_CALENDAR_SELECTABLE_YEAR
| ELM_CALENDAR_SELECTABLE_MONTH));
current_time = time(NULL) + 34 * 84600;
current_time = time(NULL) + 34 * 86400;
localtime_r(&current_time, &selected_time);
evas_object_size_hint_weight_set(cal, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
elm_box_pack_end(bx, cal);
Expand Down
4 changes: 2 additions & 2 deletions elementary/src/lib/elm_calendar.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,12 +672,12 @@ EAPI void elm_calendar_format_function_set(Evas_Object *obj, Elm
* struct tm selected_time;
* time_t current_time;
*
* current_time = time(NULL) + 5 * 84600;
* current_time = time(NULL) + 5 * 86400;
* localtime_r(&current_time, &selected_time);
* elm_calendar_mark_add(cal, "holiday", selected_time,
* ELM_CALENDAR_ANNUALLY);
*
* current_time = time(NULL) + 1 * 84600;
* current_time = time(NULL) + 1 * 86400;
* localtime_r(&current_time, &selected_time);
* elm_calendar_mark_add(cal, "checked", selected_time, ELM_CALENDAR_UNIQUE);
*
Expand Down