Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
2b49a15c
Commit
2b49a15c
authored
16 years ago
by
Emmanuel Milou
Browse files
Options
Downloads
Patches
Plain Diff
Display the date in history according to the current locale
parent
f960f93f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
sflphone-gtk/src/timestamp.c
+9
-54
9 additions, 54 deletions
sflphone-gtk/src/timestamp.c
sflphone-gtk/src/timestamp.h
+0
-2
0 additions, 2 deletions
sflphone-gtk/src/timestamp.h
with
9 additions
and
56 deletions
sflphone-gtk/src/timestamp.c
+
9
−
54
View file @
2b49a15c
...
...
@@ -19,20 +19,21 @@
#include
<timestamp.h>
gchar
*
months
[
12
]
=
{
"january"
,
"february"
,
"march"
,
"april"
,
"may"
,
"june"
,
"july"
,
"august"
,
"september"
,
"october"
,
"november"
,
"december"
};
gchar
*
week_days
[
7
]
=
{
"Sun"
,
"Mon"
,
"Tue"
,
"Wed"
,
"Thu"
,
"Fri"
,
"Sat"
};
gchar
*
timestamp_get_call_date
(
void
)
{
struct
tm
*
ptr
;
time_t
lt
;
struct
tm
*
ptr
;
time_t
lt
;
unsigned
char
str
[
100
];
lt
=
time
(
NULL
);
ptr
=
local
time
(
&
lt
);
time
(
&
lt
);
ptr
=
gm
time
(
&
lt
);
return
format
(
ptr
)
;
// result function of the current locale
strftime
((
char
*
)
str
,
100
,
"%c"
,
(
const
struct
tm
*
)
ptr
);
return
g_markup_printf_escaped
(
"
\n
%s
\n
"
,
str
);
}
gchar
*
...
...
@@ -63,49 +64,3 @@ process_call_duration( call_t* c )
return
g_markup_printf_escaped
(
_
(
"<small>Duration:</small> %s"
),
res
);
}
gchar
*
format
(
struct
tm
*
ptr
)
{
gchar
*
result
;
gchar
*
hour
,
*
min
;
gchar
*
day_of_week
,
*
month
,
*
day_number
;
if
(
ptr
->
tm_hour
<
10
)
hour
=
g_markup_printf_escaped
(
"0%i"
,
ptr
->
tm_hour
);
else
hour
=
g_markup_printf_escaped
(
"%i"
,
ptr
->
tm_hour
);
if
(
ptr
->
tm_min
<
10
)
min
=
g_markup_printf_escaped
(
"0%i"
,
ptr
->
tm_min
);
else
min
=
g_markup_printf_escaped
(
"%i"
,
ptr
->
tm_min
);
day_of_week
=
g_markup_printf_escaped
(
"%i"
,
ptr
->
tm_mday
);
month
=
months
[
ptr
->
tm_mon
];
day_number
=
week_days
[
ptr
->
tm_wday
];
result
=
g_markup_printf_escaped
(
"
\n
%s %s %s %s:%s
\n
"
,
day_number
,
month
,
day_of_week
,
hour
,
min
);
return
result
;
}
This diff is collapsed.
Click to expand it.
sflphone-gtk/src/timestamp.h
+
0
−
2
View file @
2b49a15c
...
...
@@ -36,6 +36,4 @@ gchar* timestamp_get_call_date( void );
gchar
*
process_call_duration
(
call_t
*
c
);
gchar
*
format
(
struct
tm
*
ptr
);
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment