修改原生gantt图样式(日期格式等去符合国内习惯)
This commit is contained in:
@@ -637,8 +637,10 @@ export default AbstractRenderer.extend(WidgetAdapterMixin, {
|
||||
case 'day':
|
||||
return focusDate.format('dddd, MMMM DD, YYYY');
|
||||
case 'week':
|
||||
const dateStart = focusDate.clone().startOf('week').format('DD MMMM YYYY');
|
||||
const dateEnd = focusDate.clone().endOf('week').format('DD MMMM YYYY');
|
||||
// const dateStart = focusDate.clone().startOf('week').format('DD MMMM YYYY');
|
||||
const dateStart = focusDate.clone().startOf('week').format('YYYY MMMM DD ');
|
||||
// const dateEnd = focusDate.clone().endOf('week').format('DD MMMM YYYY');
|
||||
const dateEnd = focusDate.clone().endOf('week').format('YYYY MMMM DD ');
|
||||
return _.str.sprintf('%s - %s', dateStart, dateEnd);
|
||||
case 'month':
|
||||
return focusDate.format('MMMM YYYY');
|
||||
|
||||
@@ -112,7 +112,7 @@ const GanttView = AbstractView.extend({
|
||||
allowedScales = Object.keys(this.SCALES);
|
||||
}
|
||||
|
||||
const scale = params.context.default_scale || arch.attrs.default_scale || 'month';
|
||||
const scale = params.context.default_scale || arch.attrs.default_scale || 'week';
|
||||
const initialDate = moment(params.context.initialDate || params.initialDate || arch.attrs.initial_date || new Date());
|
||||
const offset = arch.attrs.offset;
|
||||
if (offset && scale) {
|
||||
|
||||
Reference in New Issue
Block a user