adding epoch function and making date a number

This commit is contained in:
Nikola Bjelo committed 2018-10-19 14:51:00 +02:00
1 parent 039bca1571
commit d4690f3295
4 files changed
+11 -7

No files matched your search

+2 -2
View File
@@ -5,8 +5,8 @@ const competitionSchema = new Schema({
displayName: String,
host: String,
description: String,
startDatetime: Date,
finishDatetime: Date,
startDatetime: Number,
finishDatetime: Number,
formula: String,
plotter: {
codeName: String,
@@ -1,5 +1,6 @@
import {
GraphQLNonNull,
GraphQLInt,
GraphQLString
} from 'graphql'
import { CompetitionType } from '../types'
@@ -9,8 +10,8 @@ import { slugify } from '../../utils/functions'
const args = {
displayName: { type: new GraphQLNonNull(GraphQLString) },
description: { type: new GraphQLNonNull(GraphQLString) },
startDatetime: { type: new GraphQLNonNull(GraphQLString) },
finishDatetime: { type: new GraphQLNonNull(GraphQLString) },
startDatetime: { type: new GraphQLNonNull(GraphQLInt) },
finishDatetime: { type: new GraphQLNonNull(GraphQLInt) },
formula: { type: new GraphQLNonNull(GraphQLString) }
}
+3 -2
View File
@@ -1,5 +1,6 @@
import {
GraphQLObjectType,
GraphQLInt,
GraphQLString,
GraphQLList,
GraphQLID
@@ -18,8 +19,8 @@ const CompetitionType = new GraphQLObjectType({
displayName: { type: GraphQLString },
host: { type: GraphQLString },
description: { type: GraphQLString },
startDatetime: { type: GraphQLString },
finishDatetime: { type: GraphQLString },
startDatetime: { type: GraphQLInt },
finishDatetime: { type: GraphQLInt },
formula: { type: GraphQLString },
plotter: {
type: PlotterType,
+3 -1
View File
@@ -11,4 +11,6 @@ export const slugify = (text) => {
.replace(/-+$/, '')
}
export default { capitalize, slugify }
export const epoch = () => {
return Math.round(new Date().getTime() / 1000)
}