Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Changed Date pattern implementation to use bean-match

  • Loading branch information...
commit 86128c9919d7f55a464b9b5028636dd59232ea83 1 parent 830cb50
@frenchy64 frenchy64 authored
Showing with 2 additions and 19 deletions.
  1. +2 −19 src/match/date.clj
View
21 src/match/date.clj
@@ -1,21 +1,4 @@
(ns match.date
- (:use [match.core :only [IMatchLookup]]))
+ (:use [match.java :only [bean-match]]))
-(extend-type java.util.Date
- IMatchLookup
- (val-at* [this k not-found]
- (case k
- :year (.getYear this)
- :month (.getMonth this)
- :date (.getDate this)
- :hours (.getHours this)
- :minutes (.getMinutes this)
- not-found)))
-
-
-;; Example implementation using clojure.core/bean
-(comment
- (extend-type java.util.Date
- IMatchLookup
- (val-at* [this k not-found]
- (get (bean this) k not-found))))
+(bean-match java.util.Date)
Please sign in to comment.
Something went wrong with that request. Please try again.