Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add files via upload
''
  • Loading branch information
benaliabderrahmane authored Aug 6, 2021
commit fc2d031bf67607c3d81a76b9cd85bc268158c576
6 changes: 3 additions & 3 deletions plotly/plotlyfig_aux/helpers/convertDate.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function convertedDate = convertDate(date)
date.Format = 'yyyy-MM-dd HH:mm:ss';
convertedDate = char(date);
function convertedDate = convertDate(date)
date.Format = 'yyyy-MM-dd HH:mm:ss';
convertedDate = char(date);
end
46 changes: 23 additions & 23 deletions plotly/plotlyfig_aux/helpers/convertDuration.m
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
function [converted,type] = convertDuration(duration)
switch (duration.Format)
case 's'
converted = seconds(duration);
type = 'sec';
case 'm'
converted = minutes(duration);
type = 'min';
case 'h'
converted = hours(duration);
type = 'hr';
case 'd'
converted = days(duration);
type = 'days';
case 'y'
converted = years(duration);
type = 'yrs';
otherwise
%no convertion is applied
converted = duration;
type = '';

end
function [converted,type] = convertDuration(duration)
switch (duration.Format)
case 's'
converted = seconds(duration);
type = 'sec';
case 'm'
converted = minutes(duration);
type = 'min';
case 'h'
converted = hours(duration);
type = 'hr';
case 'd'
converted = days(duration);
type = 'days';
case 'y'
converted = years(duration);
type = 'yrs';
otherwise
%no convertion is applied
converted = duration;
type = '';
end
end