Lines 38-43
Link Here
|
38 |
* or JS Date, the function will return a date string formatted as per the koha instance config. |
38 |
* or JS Date, the function will return a date string formatted as per the koha instance config. |
39 |
* Optionally accepts a dateformat parameter to allow override of the configured output format |
39 |
* Optionally accepts a dateformat parameter to allow override of the configured output format |
40 |
* as well as a 'withtime' boolean denoting whether to include time or not in the output string. |
40 |
* as well as a 'withtime' boolean denoting whether to include time or not in the output string. |
|
|
41 |
* 'as_due_date' can be passed to format a date time as a due date: The time part will not be displayed if 23:59. |
41 |
*/ |
42 |
*/ |
42 |
window.$date = function(value, options) { |
43 |
window.$date = function(value, options) { |
43 |
if(!value) return ''; |
44 |
if(!value) return ''; |
Lines 54-59
Link Here
|
54 |
|
55 |
|
55 |
var timeformat = (options&&options.timeformat)||def_time_format; |
56 |
var timeformat = (options&&options.timeformat)||def_time_format; |
56 |
var date_pattern = get_date_pattern(dateformat); |
57 |
var date_pattern = get_date_pattern(dateformat); |
|
|
58 |
let as_due_date = (options&&options.as_due_date); |
59 |
if (as_due_date) { |
60 |
withtime = !( m.hour() == 23 && m.minute() == 59 ); |
61 |
} |
57 |
var time_pattern = !withtime?'':' '+get_time_pattern(timeformat); |
62 |
var time_pattern = !withtime?'':' '+get_time_pattern(timeformat); |
58 |
|
63 |
|
59 |
return m.format(date_pattern+time_pattern); |
64 |
return m.format(date_pattern+time_pattern); |
60 |
- |
|
|