This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
toBuddhistYear: (moment, format) => { | |
var christianYear = moment.format('YYYY') | |
var buddhishYear = (parseInt(christianYear) + 543).toString() | |
return moment | |
.format(format.replace('YYYY', buddhishYear).replace('YY', buddhishYear.substring(2, 4))) | |
.replace(christianYear, buddhishYear) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloServer, gql } from 'apollo-server-micro'; | |
const typeDefs = gql` | |
type Query { | |
sayHello: String | |
} | |
`; | |
const resolvers = { | |
Query: { |