Skip to content

Commit

Permalink
fix: file modified dates should now be correct
Browse files Browse the repository at this point in the history
  • Loading branch information
cadriel committed Oct 27, 2020
1 parent 7892a70 commit 9623272
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/plugins/dayjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,22 @@ export const DayJSPlugin = {
// Globally set the locale to en, we'll use the en-chart locale specifically
// for our chart labels.
dayjs.locale('en')

Vue.prototype.$dayjs = dayjs
Vue.$dayjs = dayjs
}
}

declare module 'vue/types/vue' {
interface Vue {
$dayjs(date?: dayjs.ConfigType, option?: dayjs.OptionType, locale?: string): dayjs.Dayjs;
$dayjs (date?: dayjs.ConfigType): dayjs.Dayjs;
$dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs;
$dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs;
}

interface VueConstructor {
$dayjs(date?: dayjs.ConfigType, option?: dayjs.OptionType, locale?: string): dayjs.Dayjs;
$dayjs (date?: dayjs.ConfigType): dayjs.Dayjs;
$dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, strict?: boolean): dayjs.Dayjs;
$dayjs (date?: dayjs.ConfigType, format?: dayjs.OptionType, locale?: string, strict?: boolean): dayjs.Dayjs;
}
}
2 changes: 1 addition & 1 deletion src/plugins/filters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const Filters = {
* datetime.
*/
formatFileDateTime: (datetime: number) => {
const date = _Vue.$dayjs(datetime)
const date = _Vue.$dayjs(datetime * 1000)
if (date.isToday()) {
return date.fromNow()
} else {
Expand Down
5 changes: 2 additions & 3 deletions todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
## Next Up
- add camera flip in UI.
- add buttons to home just x or y
- add swap up / down for toolhead [railcore specific...]
- add mechanism to contract / expand all panels on dash, and cleanup how we do this in a consistent way
- add file thumbs to file list, potentially move to its own nav item
- add swap up / down for toolhead [railcore specific...]
- temperature presets
- add file thumbs to file list, potentially move to its own nav item
- fix button layouts in titles
- add background image to header or sidebar, depending what we do
- machine limits (set velocity, accel, decel and square corner velocity)

## Refactoring / Core
- cleanup socket store / move socket out and keep printer data
Expand Down

0 comments on commit 9623272

Please sign in to comment.