add source for individual lending app.
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
package org.mifosng.configuration;
|
||||
|
||||
public interface ApplicationConfigurationService {
|
||||
|
||||
OAuthProviderDetails retrieveOAuthProviderDetails();
|
||||
|
||||
void update(OAuthProviderDetails newDetails);
|
||||
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
package org.mifosng.configuration;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* When application goes down or rebooted, configuration values return to defaults provided here.
|
||||
*/
|
||||
@Service
|
||||
public class InMemoryApplicationConfigurationService implements
|
||||
ApplicationConfigurationService {
|
||||
|
||||
private String oauthProviderUrl = "http://localhost:8085/mifosng-provider/";
|
||||
private String requestTokenURL = "oauth/request_token";
|
||||
private String userAuthorizationURL = "oauth/confirm_access";
|
||||
private String accessTokenURL = "oauth/access_token";
|
||||
|
||||
private String individualLendingResourceConsumerkey = "mifosng-ui-consumer-key";
|
||||
private String individualLendingConsumerSharedSecret = "testmifosng";
|
||||
|
||||
public InMemoryApplicationConfigurationService() {
|
||||
//
|
||||
}
|
||||
|
||||
@Override
|
||||
public OAuthProviderDetails retrieveOAuthProviderDetails() {
|
||||
|
||||
String requestTokenFullUrl = this.oauthProviderUrl
|
||||
.concat(this.requestTokenURL);
|
||||
String userAuthorizationFullURL = this.oauthProviderUrl
|
||||
.concat(this.userAuthorizationURL);
|
||||
String accessTokenFullURL = this.oauthProviderUrl
|
||||
.concat(this.accessTokenURL);
|
||||
|
||||
return new OAuthProviderDetails(this.oauthProviderUrl, requestTokenFullUrl,
|
||||
userAuthorizationFullURL, accessTokenFullURL,
|
||||
this.individualLendingResourceConsumerkey,
|
||||
this.individualLendingConsumerSharedSecret);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(OAuthProviderDetails newDetails) {
|
||||
this.oauthProviderUrl = newDetails.getProviderBaseUrl();
|
||||
if (!this.oauthProviderUrl.endsWith("/")) {
|
||||
this.oauthProviderUrl = this.oauthProviderUrl.concat("/");
|
||||
}
|
||||
|
||||
this.individualLendingResourceConsumerkey = newDetails.getConsumerkey();
|
||||
this.individualLendingConsumerSharedSecret = newDetails.getSharedSecret();
|
||||
}
|
||||
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
package org.mifosng.configuration;
|
||||
|
||||
public class OAuthProviderDetails {
|
||||
|
||||
private final String requestTokenUrl;
|
||||
private final String userAuthorizationUrl;
|
||||
private final String accessTokenUrl;
|
||||
private final String sharedSecret;
|
||||
private final String consumerkey;
|
||||
private final String providerBaseUrl;
|
||||
|
||||
public OAuthProviderDetails(String providerBaseUrl, String requestTokenUrl,
|
||||
String userAuthorizationUrl, String accessTokenUrl,
|
||||
String consumerkey, String sharedSecret) {
|
||||
this.providerBaseUrl = providerBaseUrl;
|
||||
this.requestTokenUrl = requestTokenUrl;
|
||||
this.userAuthorizationUrl = userAuthorizationUrl;
|
||||
this.accessTokenUrl = accessTokenUrl;
|
||||
this.consumerkey = consumerkey;
|
||||
this.sharedSecret = sharedSecret;
|
||||
}
|
||||
|
||||
public OAuthProviderDetails(String oauthProviderUrl, String consumerkey,
|
||||
String sharedSecret) {
|
||||
this.providerBaseUrl = oauthProviderUrl;
|
||||
this.consumerkey = consumerkey;
|
||||
this.sharedSecret = sharedSecret;
|
||||
this.accessTokenUrl = "";
|
||||
this.userAuthorizationUrl = "";
|
||||
this.requestTokenUrl = "";
|
||||
}
|
||||
|
||||
public String getRequestTokenUrl() {
|
||||
return requestTokenUrl;
|
||||
}
|
||||
|
||||
public String getUserAuthorizationUrl() {
|
||||
return userAuthorizationUrl;
|
||||
}
|
||||
|
||||
public String getAccessTokenUrl() {
|
||||
return accessTokenUrl;
|
||||
}
|
||||
|
||||
public String getSharedSecret() {
|
||||
return sharedSecret;
|
||||
}
|
||||
|
||||
public String getConsumerkey() {
|
||||
return consumerkey;
|
||||
}
|
||||
|
||||
public String getProviderBaseUrl() {
|
||||
return providerBaseUrl;
|
||||
}
|
||||
}
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
package org.mifosng.oauth;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
|
||||
public class ConsumerUserDetails implements UserDetails {
|
||||
|
||||
private final String username;
|
||||
private final Collection<GrantedAuthority> authorities;
|
||||
|
||||
public ConsumerUserDetails(String username, Collection<GrantedAuthority> authorities) {
|
||||
this.username = username;
|
||||
this.authorities = authorities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
return authorities;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassword() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonLocked() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean hasNoReportingAuthority() {
|
||||
return !hasReportingAuthority();
|
||||
}
|
||||
|
||||
private boolean hasReportingAuthority() {
|
||||
SimpleGrantedAuthority reportingAuthority = new SimpleGrantedAuthority("REPORTING_SUPER_USER_ROLE");
|
||||
return this.authorities.contains(reportingAuthority);
|
||||
}
|
||||
|
||||
public boolean hasNoAuthorityToSumitLoanApplication() {
|
||||
return !hasAuthorityToSumitLoanApplication();
|
||||
}
|
||||
|
||||
private boolean hasAuthorityToSumitLoanApplication() {
|
||||
return containsAnyOf(portfolioAllAuthority(), sumbitLoanApplicationAuthority(), sumbitHistoricLoanApplicationAuthority());
|
||||
}
|
||||
|
||||
private boolean containsAnyOf(SimpleGrantedAuthority... authorities) {
|
||||
boolean match = false;
|
||||
for (SimpleGrantedAuthority authority : authorities) {
|
||||
match = this.authorities.contains(authority);
|
||||
if (match) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return match;
|
||||
}
|
||||
|
||||
private SimpleGrantedAuthority portfolioAllAuthority() {
|
||||
return new SimpleGrantedAuthority("PORTFOLIO_MANAGEMENT_SUPER_USER_ROLE");
|
||||
}
|
||||
|
||||
private SimpleGrantedAuthority sumbitLoanApplicationAuthority() {
|
||||
return new SimpleGrantedAuthority("CAN_SUBMIT_NEW_LOAN_APPLICATION_ROLE");
|
||||
}
|
||||
|
||||
private SimpleGrantedAuthority sumbitHistoricLoanApplicationAuthority() {
|
||||
return new SimpleGrantedAuthority("CAN_SUBMIT_HISTORIC_LOAN_APPLICATION_ROLE");
|
||||
}
|
||||
}
|
||||
+270
@@ -0,0 +1,270 @@
|
||||
package org.mifosng.oauth;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URI;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosng.configuration.ApplicationConfigurationService;
|
||||
import org.mifosng.data.AuthenticatedUserData;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
import org.springframework.security.core.context.SecurityContext;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.core.context.SecurityContextImpl;
|
||||
import org.springframework.security.core.userdetails.UserDetails;
|
||||
import org.springframework.security.oauth.common.OAuthProviderParameter;
|
||||
import org.springframework.security.oauth.consumer.OAuthConsumerToken;
|
||||
import org.springframework.security.oauth.consumer.OAuthRequestFailedException;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContextHolder;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContextImpl;
|
||||
import org.springframework.security.oauth.consumer.ProtectedResourceDetails;
|
||||
import org.springframework.security.oauth.consumer.client.CoreOAuthConsumerSupport;
|
||||
import org.springframework.security.oauth.consumer.filter.OAuthConsumerContextFilter;
|
||||
import org.springframework.security.web.DefaultRedirectStrategy;
|
||||
import org.springframework.security.web.RedirectStrategy;
|
||||
import org.springframework.web.client.HttpStatusCodeException;
|
||||
|
||||
public class CustomOAuthConsumerContextFilter extends OAuthConsumerContextFilter {
|
||||
|
||||
private RedirectStrategy redirectStrategy = new DefaultRedirectStrategy();
|
||||
private final ApplicationConfigurationService applicationConfigurationService;
|
||||
|
||||
@Autowired
|
||||
public CustomOAuthConsumerContextFilter(final ApplicationConfigurationService applicationConfigurationService) {
|
||||
this.applicationConfigurationService = applicationConfigurationService;
|
||||
|
||||
}
|
||||
|
||||
public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException {
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
|
||||
OAuthSecurityContextImpl context = new OAuthSecurityContextImpl();
|
||||
context.setDetails(request);
|
||||
|
||||
Map<String, OAuthConsumerToken> rememberedTokens = getRememberMeServices().loadRememberedTokens(request, response);
|
||||
Map<String, OAuthConsumerToken> accessTokens = new TreeMap<String, OAuthConsumerToken>();
|
||||
Map<String, OAuthConsumerToken> requestTokens = new TreeMap<String, OAuthConsumerToken>();
|
||||
if (rememberedTokens != null) {
|
||||
for (Map.Entry<String, OAuthConsumerToken> tokenEntry : rememberedTokens.entrySet()) {
|
||||
OAuthConsumerToken token = tokenEntry.getValue();
|
||||
if (token != null) {
|
||||
if (token.isAccessToken()) {
|
||||
accessTokens.put(tokenEntry.getKey(), token);
|
||||
}
|
||||
else {
|
||||
requestTokens.put(tokenEntry.getKey(), token);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context.setAccessTokens(accessTokens);
|
||||
OAuthSecurityContextHolder.setContext(context);
|
||||
// if (LOG.isDebugEnabled()) {
|
||||
// LOG.debug("Storing access tokens in request attribute '" + getAccessTokensRequestAttribute() + "'.");
|
||||
// }
|
||||
|
||||
try {
|
||||
try {
|
||||
request.setAttribute(getAccessTokensRequestAttribute(), new ArrayList<OAuthConsumerToken>(accessTokens.values()));
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
catch (Exception e) {
|
||||
try {
|
||||
ProtectedResourceDetails resourceThatNeedsAuthorization = checkForResourceThatNeedsAuthorization(e);
|
||||
String neededResourceId = resourceThatNeedsAuthorization.getId();
|
||||
while (!accessTokens.containsKey(neededResourceId)) {
|
||||
OAuthConsumerToken token = requestTokens.remove(neededResourceId);
|
||||
if (token == null) {
|
||||
token = getTokenServices().getToken(neededResourceId);
|
||||
}
|
||||
|
||||
String verifier = request.getParameter(OAuthProviderParameter.oauth_verifier.toString());
|
||||
// if the token is null OR
|
||||
// if there is NO access token and (we're not using 1.0a or the verifier is not null)
|
||||
if (token == null || (!token.isAccessToken() && (!resourceThatNeedsAuthorization.isUse10a() || verifier == null))) {
|
||||
//no token associated with the resource, start the oauth flow.
|
||||
//if there's a request token, but no verifier, we'll assume that a previous oauth request failed and we need to get a new request token.
|
||||
// if (LOG.isDebugEnabled()) {
|
||||
// LOG.debug("Obtaining request token for resource: " + neededResourceId);
|
||||
// }
|
||||
|
||||
//obtain authorization.
|
||||
String callbackURL = response.encodeRedirectURL(getCallbackURL(request));
|
||||
token = getConsumerSupport().getUnauthorizedRequestToken(neededResourceId, callbackURL);
|
||||
// if (LOG.isDebugEnabled()) {
|
||||
// LOG.debug("Request token obtained for resource " + neededResourceId + ": " + token);
|
||||
// }
|
||||
|
||||
//okay, we've got a request token, now we need to authorize it.
|
||||
requestTokens.put(neededResourceId, token);
|
||||
getTokenServices().storeToken(neededResourceId, token);
|
||||
|
||||
|
||||
try {
|
||||
String baseURL = this.applicationConfigurationService.retrieveOAuthProviderDetails().getUserAuthorizationUrl();
|
||||
StringBuilder builder = new StringBuilder(baseURL);
|
||||
char appendChar = baseURL.indexOf('?') < 0 ? '?' : '&';
|
||||
builder.append(appendChar).append("oauth_token=");
|
||||
builder.append(URLEncoder.encode(token.getValue(), "UTF-8"));
|
||||
builder.append('&').append("oauth_callback=");
|
||||
builder.append(URLEncoder.encode(callbackURL, "UTF-8"));
|
||||
|
||||
String redirect = builder.toString();
|
||||
|
||||
request.setAttribute("org.springframework.security.oauth.consumer.AccessTokenRequiredException", e);
|
||||
this.redirectStrategy.sendRedirect(request, response, redirect);
|
||||
return;
|
||||
}
|
||||
catch (UnsupportedEncodingException use) {
|
||||
throw new IllegalStateException(use);
|
||||
}
|
||||
}
|
||||
else if (!token.isAccessToken()) {
|
||||
//we have a presumably authorized request token, let's try to get an access token with it.
|
||||
// if (LOG.isDebugEnabled()) {
|
||||
// LOG.debug("Obtaining access token for resource: " + neededResourceId);
|
||||
// }
|
||||
|
||||
//authorize the request token and store it.
|
||||
try {
|
||||
token = getConsumerSupport().getAccessToken(token, verifier);
|
||||
}
|
||||
finally {
|
||||
getTokenServices().removeToken(neededResourceId);
|
||||
}
|
||||
|
||||
// if (LOG.isDebugEnabled()) {
|
||||
// LOG.debug("Access token " + token + " obtained for resource " + neededResourceId + ". Now storing and using.");
|
||||
// }
|
||||
|
||||
getTokenServices().storeToken(neededResourceId, token);
|
||||
}
|
||||
|
||||
accessTokens.put(neededResourceId, token);
|
||||
|
||||
// hack here to detect this situation which happens once user is authenticated successfully on provider
|
||||
// and redirected back to this client application
|
||||
String oauthAccessToken = request.getParameter("oauth_token");
|
||||
String oauthVerifier = request.getParameter("oauth_verifier");
|
||||
|
||||
if (StringUtils.isNotBlank(oauthAccessToken) && StringUtils.isNotBlank(oauthVerifier)) {
|
||||
CoreOAuthConsumerSupport support = (CoreOAuthConsumerSupport)getConsumerSupport();
|
||||
|
||||
MifosNgOauthRestTemplate oauthRestTemplate = new MifosNgOauthRestTemplate(support.getProtectedResourceDetailsService());
|
||||
try {
|
||||
URI restUri = URI
|
||||
.create(getBaseServerUrl().concat("api/protected/user/"
|
||||
+ oauthAccessToken));
|
||||
|
||||
ResponseEntity<AuthenticatedUserData> s = oauthRestTemplate.exchange(restUri, HttpMethod.GET, emptyRequest(), AuthenticatedUserData.class);
|
||||
|
||||
AuthenticatedUserData userData = s.getBody();
|
||||
|
||||
SecurityContextHolder.clearContext();
|
||||
SecurityContext springSecurityContext = new SecurityContextImpl();
|
||||
|
||||
Collection<GrantedAuthority> authorities = new ArrayList<GrantedAuthority>();
|
||||
authorities.add(new SimpleGrantedAuthority("ROLE_USER"));
|
||||
for (String permissionCode : userData.getPermissions()) {
|
||||
authorities.add(new SimpleGrantedAuthority(permissionCode));
|
||||
}
|
||||
|
||||
UserDetails principal = new ConsumerUserDetails(userData.getUsername(), authorities);
|
||||
Authentication auth = new UsernamePasswordAuthenticationToken(principal, principal, principal.getAuthorities());
|
||||
springSecurityContext.setAuthentication(auth);
|
||||
|
||||
SecurityContextHolder.setContext(springSecurityContext);
|
||||
|
||||
} catch (HttpStatusCodeException ex) {
|
||||
System.err.println(ex.getResponseBodyAsString());
|
||||
throw ex;
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
//try again
|
||||
if (!response.isCommitted()) {
|
||||
request.setAttribute(getAccessTokensRequestAttribute(), new ArrayList<OAuthConsumerToken>(accessTokens.values()));
|
||||
chain.doFilter(request, response);
|
||||
}
|
||||
else {
|
||||
//dang. what do we do now?
|
||||
throw new IllegalStateException("Unable to reprocess filter chain with needed OAuth2 resources because the response is already committed.");
|
||||
}
|
||||
}
|
||||
catch (Exception e1) {
|
||||
resourceThatNeedsAuthorization = checkForResourceThatNeedsAuthorization(e1);
|
||||
neededResourceId = resourceThatNeedsAuthorization.getId();
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (OAuthRequestFailedException eo) {
|
||||
fail(request, response, eo);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Throwable[] causeChain = getThrowableAnalyzer().determineCauseChain(ex);
|
||||
OAuthRequestFailedException rfe = (OAuthRequestFailedException) getThrowableAnalyzer().getFirstThrowableOfType(OAuthRequestFailedException.class, causeChain);
|
||||
if (rfe != null) {
|
||||
fail(request, response, rfe);
|
||||
}
|
||||
else {
|
||||
// Rethrow ServletExceptions and RuntimeExceptions as-is
|
||||
if (ex instanceof ServletException) {
|
||||
throw (ServletException) ex;
|
||||
}
|
||||
else if (ex instanceof RuntimeException) {
|
||||
throw (RuntimeException) ex;
|
||||
}
|
||||
|
||||
// Wrap other Exceptions. These are not expected to happen
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
OAuthSecurityContextHolder.setContext(null);
|
||||
HashMap<String, OAuthConsumerToken> tokensToRemember = new HashMap<String, OAuthConsumerToken>();
|
||||
tokensToRemember.putAll(requestTokens);
|
||||
tokensToRemember.putAll(accessTokens);
|
||||
getRememberMeServices().rememberTokens(tokensToRemember, request, response);
|
||||
}
|
||||
}
|
||||
|
||||
private HttpEntity<Object> emptyRequest() {
|
||||
HttpHeaders requestHeaders = new HttpHeaders();
|
||||
requestHeaders.set("Accept", "application/xml");
|
||||
requestHeaders.set("Content-Type", "application/xml");
|
||||
|
||||
HttpEntity<Object> requestEntity = new HttpEntity<Object>(
|
||||
requestHeaders);
|
||||
return requestEntity;
|
||||
}
|
||||
|
||||
private String getBaseServerUrl() {
|
||||
return this.applicationConfigurationService.retrieveOAuthProviderDetails().getProviderBaseUrl();
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package org.mifosng.oauth;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.authentication.InsufficientAuthenticationException;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.security.oauth.consumer.AccessTokenRequiredException;
|
||||
import org.springframework.security.oauth.consumer.OAuthConsumerToken;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContext;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContextHolder;
|
||||
import org.springframework.security.oauth.consumer.filter.OAuthConsumerProcessingFilter;
|
||||
|
||||
public class CustomOAuthConsumerProcessingFilter extends
|
||||
OAuthConsumerProcessingFilter {
|
||||
|
||||
@Override
|
||||
public void doFilter(ServletRequest servletRequest,
|
||||
ServletResponse servletResponse, FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
|
||||
Set<String> accessTokenDeps = getAccessTokenDependencies(request,
|
||||
response, chain);
|
||||
if (!accessTokenDeps.isEmpty()) {
|
||||
Authentication authentication = SecurityContextHolder.getContext()
|
||||
.getAuthentication();
|
||||
if (isRequireAuthenticated() && !authentication.isAuthenticated()) {
|
||||
throw new InsufficientAuthenticationException(
|
||||
"An authenticated principal must be present.");
|
||||
}
|
||||
|
||||
OAuthSecurityContext context = OAuthSecurityContextHolder
|
||||
.getContext();
|
||||
if (context == null) {
|
||||
throw new IllegalStateException(
|
||||
"No OAuth security context has been established. Unable to access resources.");
|
||||
}
|
||||
|
||||
Map<String, OAuthConsumerToken> accessTokens = context
|
||||
.getAccessTokens();
|
||||
|
||||
for (String dependency : accessTokenDeps) {
|
||||
if (!accessTokens.containsKey(dependency)) {
|
||||
throw new AccessTokenRequiredException(
|
||||
getProtectedResourceDetailsService()
|
||||
.loadProtectedResourceDetailsById(
|
||||
dependency));
|
||||
}
|
||||
}
|
||||
|
||||
chain.doFilter(request, response);
|
||||
} else {
|
||||
chain.doFilter(servletRequest, servletResponse);
|
||||
}
|
||||
}
|
||||
}
|
||||
+233
@@ -0,0 +1,233 @@
|
||||
package org.mifosng.oauth;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.servlet.FilterChain;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.ServletRequest;
|
||||
import javax.servlet.ServletResponse;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.mifosng.ui.JaxRs311ErrorResponseHandler;
|
||||
import org.springframework.security.oauth.common.OAuthProviderParameter;
|
||||
import org.springframework.security.oauth.consumer.OAuthConsumerToken;
|
||||
import org.springframework.security.oauth.consumer.OAuthRequestFailedException;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContextHolder;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContextImpl;
|
||||
import org.springframework.security.oauth.consumer.ProtectedResourceDetails;
|
||||
import org.springframework.security.oauth.consumer.filter.OAuthConsumerContextFilter;
|
||||
import org.springframework.web.client.DefaultResponseErrorHandler;
|
||||
import org.springframework.web.client.ResponseErrorHandler;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
public class MifosNgOauthConsumerContextFilter extends
|
||||
OAuthConsumerContextFilter {
|
||||
|
||||
private static final Log LOG = LogFactory
|
||||
.getLog(MifosNgOauthConsumerContextFilter.class);
|
||||
|
||||
private RestTemplate noAuthRestTemplate;
|
||||
|
||||
@Override
|
||||
public void doFilter(final ServletRequest servletRequest,
|
||||
final ServletResponse servletResponse, final FilterChain chain)
|
||||
throws IOException, ServletException {
|
||||
|
||||
ResponseErrorHandler defaultResponseErrorHandler = new DefaultResponseErrorHandler();
|
||||
ResponseErrorHandler jaxrs311ErrorResponseHandler = new JaxRs311ErrorResponseHandler(
|
||||
defaultResponseErrorHandler);
|
||||
this.noAuthRestTemplate = new RestTemplate();
|
||||
this.noAuthRestTemplate.setErrorHandler(jaxrs311ErrorResponseHandler);
|
||||
|
||||
HttpServletRequest request = (HttpServletRequest) servletRequest;
|
||||
HttpServletResponse response = (HttpServletResponse) servletResponse;
|
||||
OAuthSecurityContextImpl context = new OAuthSecurityContextImpl();
|
||||
context.setDetails(request);
|
||||
|
||||
Map<String, OAuthConsumerToken> rememberedTokens = getRememberMeServices()
|
||||
.loadRememberedTokens(request, response);
|
||||
Map<String, OAuthConsumerToken> accessTokens = new TreeMap<String, OAuthConsumerToken>();
|
||||
Map<String, OAuthConsumerToken> requestTokens = new TreeMap<String, OAuthConsumerToken>();
|
||||
if (rememberedTokens != null) {
|
||||
for (Map.Entry<String, OAuthConsumerToken> tokenEntry : rememberedTokens
|
||||
.entrySet()) {
|
||||
OAuthConsumerToken token = tokenEntry.getValue();
|
||||
if (token != null) {
|
||||
if (token.isAccessToken()) {
|
||||
accessTokens.put(tokenEntry.getKey(), token);
|
||||
} else {
|
||||
requestTokens.put(tokenEntry.getKey(), token);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context.setAccessTokens(accessTokens);
|
||||
OAuthSecurityContextHolder.setContext(context);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Storing access tokens in request attribute '"
|
||||
+ getAccessTokensRequestAttribute() + "'.");
|
||||
}
|
||||
|
||||
try {
|
||||
try {
|
||||
request.setAttribute(
|
||||
getAccessTokensRequestAttribute(),
|
||||
new ArrayList<OAuthConsumerToken>(accessTokens.values()));
|
||||
chain.doFilter(request, response);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
ProtectedResourceDetails resourceThatNeedsAuthorization = checkForResourceThatNeedsAuthorization(e);
|
||||
String neededResourceId = resourceThatNeedsAuthorization
|
||||
.getId();
|
||||
while (!accessTokens.containsKey(neededResourceId)) {
|
||||
OAuthConsumerToken token = requestTokens
|
||||
.remove(neededResourceId);
|
||||
if (token == null) {
|
||||
token = getTokenServices().getToken(
|
||||
neededResourceId);
|
||||
}
|
||||
|
||||
String verifier = request
|
||||
.getParameter(OAuthProviderParameter.oauth_verifier
|
||||
.toString());
|
||||
// if the token is null OR
|
||||
// if there is NO access token and (we're not using 1.0a
|
||||
// or the verifier is not null)
|
||||
if (token == null
|
||||
|| !token.isAccessToken()
|
||||
&& (!resourceThatNeedsAuthorization.isUse10a() || verifier == null)) {
|
||||
// no token associated with the resource, start the
|
||||
// oauth flow.
|
||||
// if there's a request token, but no verifier,
|
||||
// we'll assume that a previous oauth request failed
|
||||
// and we need to get a new request token.
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Obtaining request token for resource: "
|
||||
+ neededResourceId);
|
||||
}
|
||||
|
||||
// obtain authorization.
|
||||
String callbackURL = response
|
||||
.encodeRedirectURL(getCallbackURL(request));
|
||||
token = getConsumerSupport()
|
||||
.getUnauthorizedRequestToken(
|
||||
neededResourceId, callbackURL);
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Request token obtained for resource "
|
||||
+ neededResourceId + ": " + token);
|
||||
}
|
||||
|
||||
// okay, we've got a request token, now we need to
|
||||
// authorize it.
|
||||
requestTokens.put(neededResourceId, token);
|
||||
getTokenServices().storeToken(neededResourceId,
|
||||
token);
|
||||
String redirect = getUserAuthorizationRedirectURL(
|
||||
resourceThatNeedsAuthorization, token,
|
||||
callbackURL);
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Redirecting request to "
|
||||
+ redirect
|
||||
+ " for user authorization of the request token for resource "
|
||||
+ neededResourceId + ".");
|
||||
}
|
||||
|
||||
request.setAttribute(
|
||||
"org.springframework.security.oauth.consumer.AccessTokenRequiredException",
|
||||
e);
|
||||
getRedirectStrategy().sendRedirect(request,
|
||||
response, redirect);
|
||||
return;
|
||||
} else if (!token.isAccessToken()) {
|
||||
// we have a presumably authorized request token,
|
||||
// let's try to get an access token with it.
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Obtaining access token for resource: "
|
||||
+ neededResourceId);
|
||||
}
|
||||
|
||||
// authorize the request token and store it.
|
||||
try {
|
||||
token = getConsumerSupport().getAccessToken(
|
||||
token, verifier);
|
||||
} finally {
|
||||
getTokenServices()
|
||||
.removeToken(neededResourceId);
|
||||
}
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Access token " + token
|
||||
+ " obtained for resource "
|
||||
+ neededResourceId
|
||||
+ ". Now storing and using.");
|
||||
}
|
||||
|
||||
getTokenServices().storeToken(neededResourceId,
|
||||
token);
|
||||
}
|
||||
|
||||
accessTokens.put(neededResourceId, token);
|
||||
|
||||
try {
|
||||
// try again
|
||||
if (!response.isCommitted()) {
|
||||
request.setAttribute(
|
||||
getAccessTokensRequestAttribute(),
|
||||
new ArrayList<OAuthConsumerToken>(
|
||||
accessTokens.values()));
|
||||
chain.doFilter(request, response);
|
||||
} else {
|
||||
// dang. what do we do now?
|
||||
throw new IllegalStateException(
|
||||
"Unable to reprocess filter chain with needed OAuth2 resources because the response is already committed.");
|
||||
}
|
||||
} catch (Exception e1) {
|
||||
resourceThatNeedsAuthorization = checkForResourceThatNeedsAuthorization(e1);
|
||||
neededResourceId = resourceThatNeedsAuthorization
|
||||
.getId();
|
||||
}
|
||||
}
|
||||
} catch (OAuthRequestFailedException eo) {
|
||||
fail(request, response, eo);
|
||||
} catch (Exception ex) {
|
||||
Throwable[] causeChain = getThrowableAnalyzer()
|
||||
.determineCauseChain(ex);
|
||||
OAuthRequestFailedException rfe = (OAuthRequestFailedException) getThrowableAnalyzer()
|
||||
.getFirstThrowableOfType(
|
||||
OAuthRequestFailedException.class,
|
||||
causeChain);
|
||||
if (rfe != null) {
|
||||
fail(request, response, rfe);
|
||||
} else {
|
||||
// Rethrow ServletExceptions and RuntimeExceptions as-is
|
||||
if (ex instanceof ServletException) {
|
||||
throw (ServletException) ex;
|
||||
} else if (ex instanceof RuntimeException) {
|
||||
throw (RuntimeException) ex;
|
||||
}
|
||||
|
||||
// Wrap other Exceptions. These are not expected to
|
||||
// happen
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
OAuthSecurityContextHolder.setContext(null);
|
||||
HashMap<String, OAuthConsumerToken> tokensToRemember = new HashMap<String, OAuthConsumerToken>();
|
||||
tokensToRemember.putAll(requestTokens);
|
||||
tokensToRemember.putAll(accessTokens);
|
||||
getRememberMeServices().rememberTokens(tokensToRemember, request,
|
||||
response);
|
||||
}
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package org.mifosng.oauth;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.oauth.consumer.ProtectedResourceDetailsService;
|
||||
import org.springframework.security.oauth.consumer.client.OAuthRestTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service(value="oauthRestServiceTemplate")
|
||||
public class MifosNgOauthRestTemplate extends OAuthRestTemplate {
|
||||
|
||||
@Autowired
|
||||
public MifosNgOauthRestTemplate(ProtectedResourceDetailsService protectedResourceDetailsService) {
|
||||
super(protectedResourceDetailsService.loadProtectedResourceDetailsById("protectedMifosNgServices"));
|
||||
}
|
||||
|
||||
}
|
||||
+69
@@ -0,0 +1,69 @@
|
||||
package org.mifosng.oauth;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.mifosng.configuration.ApplicationConfigurationService;
|
||||
import org.mifosng.configuration.OAuthProviderDetails;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.oauth.common.signature.SharedConsumerSecret;
|
||||
import org.springframework.security.oauth.consumer.BaseProtectedResourceDetails;
|
||||
import org.springframework.security.oauth.consumer.ProtectedResourceDetails;
|
||||
import org.springframework.security.oauth.consumer.ProtectedResourceDetailsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service(value="mifosNgInMemoryResourceDetailsService")
|
||||
public class MifosNgProtectedResourceDetailsService implements
|
||||
ProtectedResourceDetailsService, RefreshableProtectedResourceDetailsService {
|
||||
|
||||
private Map<String, ProtectedResourceDetails> resourceDetailsStore = new HashMap<String, ProtectedResourceDetails>();
|
||||
private final ApplicationConfigurationService applicationConfigurationService;
|
||||
|
||||
@Autowired
|
||||
public MifosNgProtectedResourceDetailsService(ApplicationConfigurationService applicationConfigurationService) {
|
||||
this.applicationConfigurationService = applicationConfigurationService;
|
||||
addHardcodedMifosNgResourceIdToStore();
|
||||
}
|
||||
|
||||
private void addHardcodedMifosNgResourceIdToStore() {
|
||||
BaseProtectedResourceDetails individualLendingResourceDetails = new BaseProtectedResourceDetails();
|
||||
individualLendingResourceDetails.setId("protectedMifosNgServices");
|
||||
|
||||
OAuthProviderDetails oauthProviderDetails = applicationConfigurationService
|
||||
.retrieveOAuthProviderDetails();
|
||||
|
||||
individualLendingResourceDetails
|
||||
.setRequestTokenURL(oauthProviderDetails.getRequestTokenUrl());
|
||||
individualLendingResourceDetails
|
||||
.setUserAuthorizationURL(oauthProviderDetails
|
||||
.getUserAuthorizationUrl());
|
||||
individualLendingResourceDetails.setAccessTokenURL(oauthProviderDetails
|
||||
.getAccessTokenUrl());
|
||||
|
||||
individualLendingResourceDetails.setConsumerKey(oauthProviderDetails
|
||||
.getConsumerkey());
|
||||
individualLendingResourceDetails
|
||||
.setSharedSecret(new SharedConsumerSecret(oauthProviderDetails
|
||||
.getSharedSecret()));
|
||||
|
||||
resourceDetailsStore.put(
|
||||
individualLendingResourceDetails.getId(),
|
||||
individualLendingResourceDetails);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProtectedResourceDetails loadProtectedResourceDetailsById(
|
||||
final String id) throws IllegalArgumentException {
|
||||
return resourceDetailsStore.get(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void refresh() {
|
||||
resourceDetailsStore.clear();
|
||||
addHardcodedMifosNgResourceIdToStore();
|
||||
}
|
||||
|
||||
public ApplicationConfigurationService getApplicationConfigurationService() {
|
||||
return applicationConfigurationService;
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
package org.mifosng.oauth;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import org.springframework.security.access.ConfigAttribute;
|
||||
import org.springframework.security.access.SecurityConfig;
|
||||
import org.springframework.security.web.access.intercept.DefaultFilterInvocationSecurityMetadataSource;
|
||||
import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
|
||||
import org.springframework.security.web.util.AntPathRequestMatcher;
|
||||
import org.springframework.security.web.util.RequestMatcher;
|
||||
|
||||
public class OAuthConsumerFilterFilterInvocationSecurityMetadataSource
|
||||
implements FilterInvocationSecurityMetadataSource {
|
||||
|
||||
private final FilterInvocationSecurityMetadataSource metadataSource;
|
||||
|
||||
public OAuthConsumerFilterFilterInvocationSecurityMetadataSource() {
|
||||
LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> requestMap = new LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>>();
|
||||
RequestMatcher key = new AntPathRequestMatcher("/sparklr/**");
|
||||
Collection<ConfigAttribute> value = new ArrayList<ConfigAttribute>();
|
||||
value.add(new SecurityConfig("sparklrPhotos"));
|
||||
requestMap.put(key, value);
|
||||
|
||||
this.metadataSource = new DefaultFilterInvocationSecurityMetadataSource(
|
||||
requestMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ConfigAttribute> getAttributes(final Object object)
|
||||
throws IllegalArgumentException {
|
||||
return this.metadataSource.getAttributes(object);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ConfigAttribute> getAllConfigAttributes() {
|
||||
return this.metadataSource.getAllConfigAttributes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(final Class<?> clazz) {
|
||||
return this.metadataSource.supports(clazz);
|
||||
}
|
||||
}
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
package org.mifosng.oauth;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.mifosng.configuration.OAuthProviderDetails;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.oauth.consumer.OAuthConsumerToken;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContextHolder;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContextImpl;
|
||||
import org.springframework.security.oauth.consumer.rememberme.OAuthRememberMeServices;
|
||||
import org.springframework.security.web.authentication.logout.LogoutHandler;
|
||||
import org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler;
|
||||
|
||||
/**
|
||||
* Logout Filter process before oauth filters are applied so need create OAuthSercurityContext and populate with 'remembered tokens' first.
|
||||
*/
|
||||
public class OAuthLogoutHandler implements LogoutHandler {
|
||||
|
||||
private final SecurityContextLogoutHandler delegate;
|
||||
private final MifosNgProtectedResourceDetailsService protectedResourceDetailsService;
|
||||
private final OAuthRememberMeServices oAuthRememberMeServices;
|
||||
|
||||
public OAuthLogoutHandler(final SecurityContextLogoutHandler delegate, final MifosNgProtectedResourceDetailsService protectedResourceDetailsService,
|
||||
final OAuthRememberMeServices oAuthRememberMeServices) {
|
||||
this.delegate = delegate;
|
||||
this.protectedResourceDetailsService = protectedResourceDetailsService;
|
||||
this.oAuthRememberMeServices = oAuthRememberMeServices;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void logout(HttpServletRequest request,
|
||||
HttpServletResponse response, Authentication authentication) {
|
||||
|
||||
this.delegate.logout(request, response, authentication);
|
||||
|
||||
OAuthSecurityContextImpl context = new OAuthSecurityContextImpl();
|
||||
context.setDetails(request);
|
||||
|
||||
Map<String, OAuthConsumerToken> rememberedTokens = this.oAuthRememberMeServices.loadRememberedTokens(request, response);
|
||||
Map<String, OAuthConsumerToken> accessTokens = new TreeMap<String, OAuthConsumerToken>();
|
||||
if (rememberedTokens != null) {
|
||||
for (Map.Entry<String, OAuthConsumerToken> tokenEntry : rememberedTokens.entrySet()) {
|
||||
OAuthConsumerToken token = tokenEntry.getValue();
|
||||
if (token != null) {
|
||||
if (token.isAccessToken()) {
|
||||
accessTokens.put(tokenEntry.getKey(), token);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
context.setAccessTokens(accessTokens);
|
||||
OAuthSecurityContextHolder.setContext(context);
|
||||
|
||||
if (!accessTokens.isEmpty()) {
|
||||
MifosNgOauthRestTemplate oauthRestTemplate = new MifosNgOauthRestTemplate(
|
||||
protectedResourceDetailsService);
|
||||
|
||||
OAuthProviderDetails providerDetails = this.protectedResourceDetailsService
|
||||
.getApplicationConfigurationService()
|
||||
.retrieveOAuthProviderDetails();
|
||||
|
||||
URI restUri = URI.create(providerDetails.getProviderBaseUrl()
|
||||
.concat("api/protected/user/signout"));
|
||||
|
||||
oauthRestTemplate.exchange(restUri, HttpMethod.GET, emptyRequest(),
|
||||
null);
|
||||
}
|
||||
|
||||
OAuthSecurityContextHolder.setContext(null);
|
||||
}
|
||||
|
||||
|
||||
private HttpEntity<Object> emptyRequest() {
|
||||
HttpHeaders requestHeaders = new HttpHeaders();
|
||||
requestHeaders.set("Accept", "application/xml");
|
||||
requestHeaders.set("Content-Type", "application/xml");
|
||||
|
||||
HttpEntity<Object> requestEntity = new HttpEntity<Object>(
|
||||
requestHeaders);
|
||||
return requestEntity;
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package org.mifosng.oauth;
|
||||
|
||||
public interface RefreshableProtectedResourceDetailsService {
|
||||
|
||||
void refresh();
|
||||
|
||||
}
|
||||
+177
@@ -0,0 +1,177 @@
|
||||
package org.mifosng.ui;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
|
||||
import org.mifosng.data.AppUserData;
|
||||
import org.mifosng.data.ClientData;
|
||||
import org.mifosng.data.ClientDataWithAccountsData;
|
||||
import org.mifosng.data.CurrencyData;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.EnumOptionReadModel;
|
||||
import org.mifosng.data.ExtraDatasets;
|
||||
import org.mifosng.data.LoanAccountData;
|
||||
import org.mifosng.data.LoanProductData;
|
||||
import org.mifosng.data.LoanRepaymentData;
|
||||
import org.mifosng.data.LoanSchedule;
|
||||
import org.mifosng.data.NewLoanWorkflowStepOneData;
|
||||
import org.mifosng.data.NoteData;
|
||||
import org.mifosng.data.OfficeData;
|
||||
import org.mifosng.data.PermissionData;
|
||||
import org.mifosng.data.RoleData;
|
||||
import org.mifosng.data.command.AdjustLoanTransactionCommand;
|
||||
import org.mifosng.data.command.CalculateLoanScheduleCommand;
|
||||
import org.mifosng.data.command.ChangePasswordCommand;
|
||||
import org.mifosng.data.command.CreateLoanProductCommand;
|
||||
import org.mifosng.data.command.EnrollClientCommand;
|
||||
import org.mifosng.data.command.LoanStateTransitionCommand;
|
||||
import org.mifosng.data.command.LoanTransactionCommand;
|
||||
import org.mifosng.data.command.NoteCommand;
|
||||
import org.mifosng.data.command.OfficeCommand;
|
||||
import org.mifosng.data.command.RoleCommand;
|
||||
import org.mifosng.data.command.SubmitLoanApplicationCommand;
|
||||
import org.mifosng.data.command.UndoLoanApprovalCommand;
|
||||
import org.mifosng.data.command.UndoLoanDisbursalCommand;
|
||||
import org.mifosng.data.command.UpdateLoanProductCommand;
|
||||
import org.mifosng.data.command.UpdateOrganisationCurrencyCommand;
|
||||
import org.mifosng.data.command.UserCommand;
|
||||
import org.mifosng.data.reports.GenericResultset;
|
||||
import org.springframework.security.oauth.consumer.ProtectedResourceDetails;
|
||||
|
||||
public interface CommonRestOperations {
|
||||
|
||||
void logout(String accessToken);
|
||||
|
||||
void updateProtectedResource(
|
||||
ProtectedResourceDetails loadProtectedResourceDetailsById);
|
||||
|
||||
void updateOrganisationCurrencies(UpdateOrganisationCurrencyCommand command);
|
||||
|
||||
Collection<OfficeData> retrieveAllOffices();
|
||||
|
||||
OfficeData retrieveOffice(Long officeId);
|
||||
|
||||
Collection<AppUserData> retrieveAllUsers();
|
||||
|
||||
AppUserData retrieveNewUserDetails();
|
||||
|
||||
AppUserData retrieveUser(Long userId);
|
||||
|
||||
AppUserData retrieveCurrentUser();
|
||||
|
||||
EntityIdentifier createUser(UserCommand command);
|
||||
|
||||
EntityIdentifier updateUser(UserCommand command);
|
||||
|
||||
EntityIdentifier updateCurrentUserPassword(ChangePasswordCommand command);
|
||||
|
||||
void deleteUser(Long userId);
|
||||
|
||||
Collection<RoleData> retrieveAllRoles();
|
||||
|
||||
RoleData retrieveRole(Long roleId);
|
||||
|
||||
RoleData retrieveNewRoleDetails();
|
||||
|
||||
EntityIdentifier updateRole(RoleCommand command);
|
||||
|
||||
Collection<PermissionData> retrieveAllPermissions();
|
||||
|
||||
Collection<EnumOptionReadModel> retrieveAllPermissionGroups();
|
||||
|
||||
EntityIdentifier createRole(RoleCommand command);
|
||||
|
||||
EntityIdentifier createOffice(OfficeCommand command);
|
||||
|
||||
EntityIdentifier updateOffice(OfficeCommand command);
|
||||
|
||||
Collection<ClientData> retrieveAllIndividualClients();
|
||||
|
||||
Collection<LoanProductData> retrieveAllLoanProducts();
|
||||
|
||||
Collection<CurrencyData> retrieveAllowedCurrencies();
|
||||
|
||||
Collection<CurrencyData> retrieveAllPlatformCurrencies();
|
||||
|
||||
Collection<EnumOptionReadModel> retrieveAllowedLoanAmortizationMethodOptions();
|
||||
|
||||
Collection<EnumOptionReadModel> retrieveAllowedLoanInterestMethodOptions();
|
||||
|
||||
Collection<EnumOptionReadModel> retrieveAllowedRepaymentFrequencyOptions();
|
||||
|
||||
Collection<EnumOptionReadModel> retrieveAllowedNominalInterestFrequencyOptions();
|
||||
|
||||
EntityIdentifier createLoanProduct(CreateLoanProductCommand command);
|
||||
|
||||
EntityIdentifier updateLoanProduct(UpdateLoanProductCommand command);
|
||||
|
||||
LoanProductData retrieveLoanProductDetails(Long selectedLoanProductOption);
|
||||
|
||||
LoanProductData retrieveNewLoanProductDetails();
|
||||
|
||||
LoanSchedule calculateLoanSchedule(CalculateLoanScheduleCommand command);
|
||||
|
||||
NewLoanWorkflowStepOneData retrieveNewLoanApplicationStepOneDetails(
|
||||
Long clientId);
|
||||
|
||||
Long submitLoanApplication(SubmitLoanApplicationCommand command);
|
||||
|
||||
EntityIdentifier deleteLoan(Long loanId);
|
||||
|
||||
EntityIdentifier approveLoan(LoanStateTransitionCommand command);
|
||||
|
||||
EntityIdentifier undoLoanApproval(UndoLoanApprovalCommand command);
|
||||
|
||||
EntityIdentifier rejectLoan(LoanStateTransitionCommand command);
|
||||
|
||||
EntityIdentifier withdrawLoan(LoanStateTransitionCommand command);
|
||||
|
||||
EntityIdentifier disburseLoan(LoanStateTransitionCommand command);
|
||||
|
||||
EntityIdentifier undloLoanDisbursal(UndoLoanDisbursalCommand command);
|
||||
|
||||
LoanRepaymentData retrieveNewLoanRepaymentDetails(Long loanId);
|
||||
|
||||
LoanRepaymentData retrieveLoanRepaymentDetails(Long loanId, Long repaymentId);
|
||||
|
||||
EntityIdentifier makeLoanRepayment(LoanTransactionCommand command);
|
||||
|
||||
EntityIdentifier adjustLoanRepayment(AdjustLoanTransactionCommand command);
|
||||
|
||||
LoanRepaymentData retrieveNewLoanWaiverDetails(Long loanId);
|
||||
|
||||
EntityIdentifier waiveLoanAmount(LoanTransactionCommand command);
|
||||
|
||||
EntityIdentifier updateCurrentUserDetails(UserCommand command);
|
||||
|
||||
ClientData retrieveNewIndividualClient();
|
||||
|
||||
ClientData retrieveClientDetails(Long clientId);
|
||||
|
||||
EntityIdentifier enrollClient(EnrollClientCommand command);
|
||||
|
||||
EntityIdentifier addNote(NoteCommand command);
|
||||
|
||||
EntityIdentifier updateNote(NoteCommand command);
|
||||
|
||||
NoteData retrieveClientNote(Long clientId, Long noteId);
|
||||
|
||||
Collection<NoteData> retrieveClientNotes(Long clientId);
|
||||
|
||||
ClientDataWithAccountsData retrieveClientAccount(Long clientId);
|
||||
|
||||
LoanAccountData retrieveLoanAccount(Long loanId);
|
||||
|
||||
ExtraDatasets retrieveExtraDatasets(String datasetType);
|
||||
|
||||
GenericResultset retrieveExtraData(String datasetType, String datasetName,
|
||||
String datasetPKValue);
|
||||
|
||||
@SuppressWarnings("rawtypes")
|
||||
EntityIdentifier saveExtraData(String datasetType, String datasetName,
|
||||
String datasetPKValue, Map map);
|
||||
|
||||
GenericResultset retrieveReportingData(String rptDB, String name, String type, Map<String, String> extractedQueryParams);
|
||||
|
||||
NewLoanWorkflowStepOneData retrieveNewLoanApplicationDetails(Long clientId, Long productId);
|
||||
}
|
||||
+1353
File diff suppressed because it is too large
Load Diff
+34
@@ -0,0 +1,34 @@
|
||||
package org.mifosng.ui;
|
||||
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.client.RestClientException;
|
||||
|
||||
public class Jax2bRestClientException extends RestClientException {
|
||||
|
||||
private final HttpStatus statusCode;
|
||||
private final MediaType contentType;
|
||||
private final ErrorResponse errorResponse;
|
||||
|
||||
public Jax2bRestClientException(final HttpStatus statusCode,
|
||||
final MediaType contentType, final ErrorResponse errorResponse) {
|
||||
super(statusCode.name() + ": on client http rest request.");
|
||||
this.statusCode = statusCode;
|
||||
this.contentType = contentType;
|
||||
this.errorResponse = errorResponse;
|
||||
}
|
||||
|
||||
public HttpStatus getStatusCode() {
|
||||
return this.statusCode;
|
||||
}
|
||||
|
||||
public MediaType getContentType() {
|
||||
return this.contentType;
|
||||
}
|
||||
|
||||
public ErrorResponse getErrorResponse() {
|
||||
return this.errorResponse;
|
||||
}
|
||||
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package org.mifosng.ui;
|
||||
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.web.client.RestClientException;
|
||||
|
||||
public class Jax2bRestServerException extends RestClientException {
|
||||
|
||||
private final HttpStatus statusCode;
|
||||
private final MediaType contentType;
|
||||
private final ErrorResponse errorResponse;
|
||||
|
||||
public Jax2bRestServerException(final HttpStatus statusCode,
|
||||
final MediaType contentType, final ErrorResponse errorResponse) {
|
||||
super(statusCode.name() + ": on client http rest request.");
|
||||
this.statusCode = statusCode;
|
||||
this.contentType = contentType;
|
||||
this.errorResponse = errorResponse;
|
||||
}
|
||||
|
||||
public HttpStatus getStatusCode() {
|
||||
return this.statusCode;
|
||||
}
|
||||
|
||||
public MediaType getContentType() {
|
||||
return this.contentType;
|
||||
}
|
||||
|
||||
public ErrorResponse getErrorResponse() {
|
||||
return this.errorResponse;
|
||||
}
|
||||
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package org.mifosng.ui;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter;
|
||||
import org.springframework.web.client.ResponseErrorHandler;
|
||||
import org.springframework.web.client.RestClientException;
|
||||
|
||||
public class JaxRs311ErrorResponseHandler implements ResponseErrorHandler {
|
||||
|
||||
private final ResponseErrorHandler delegateResponseErrorHandler;
|
||||
|
||||
public JaxRs311ErrorResponseHandler(
|
||||
final ResponseErrorHandler delegateResponseErrorHandler) {
|
||||
this.delegateResponseErrorHandler = delegateResponseErrorHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasError(final ClientHttpResponse response) throws IOException {
|
||||
return this.delegateResponseErrorHandler.hasError(response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleError(final ClientHttpResponse response) throws IOException {
|
||||
|
||||
HttpStatus statusCode = response.getStatusCode();
|
||||
MediaType contentType = response.getHeaders().getContentType();
|
||||
|
||||
Jaxb2RootElementHttpMessageConverter converter = new Jaxb2RootElementHttpMessageConverter();
|
||||
ErrorResponse errorResponse = (ErrorResponse) converter.read(
|
||||
ErrorResponse.class, response);
|
||||
|
||||
switch (statusCode.series()) {
|
||||
case CLIENT_ERROR:
|
||||
throw new Jax2bRestClientException(statusCode, contentType, errorResponse);
|
||||
case SERVER_ERROR:
|
||||
throw new Jax2bRestServerException(statusCode, contentType,
|
||||
errorResponse);
|
||||
default:
|
||||
throw new RestClientException("Unknown status code [" + statusCode
|
||||
+ "]");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
+106
@@ -0,0 +1,106 @@
|
||||
package org.mifosng.ui.admin;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.mifosng.data.AppUserData;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.mifosng.data.command.ChangePasswordCommand;
|
||||
import org.mifosng.data.command.UserCommand;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.mifosng.ui.loanproduct.ClientValidationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
/**
|
||||
* Controller for user and organisation administration functions.
|
||||
*/
|
||||
@Controller
|
||||
public class AdministrationController {
|
||||
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public AdministrationController(final CommonRestOperations commonRestOperations) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
}
|
||||
|
||||
@ExceptionHandler(ClientValidationException.class)
|
||||
public @ResponseBody Collection<ErrorResponse> validationException(ClientValidationException ex, HttpServletResponse response) {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.setContentType("application/json");
|
||||
|
||||
return ex.getValidationErrors();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/org/admin", method = RequestMethod.GET)
|
||||
public String organisationAdminScreen() {
|
||||
return "admin/orghome";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/org/admin/user", method = RequestMethod.GET)
|
||||
public String userAdminScreen() {
|
||||
return "admin/userhome";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/org/admin/settings", method = RequestMethod.GET)
|
||||
public String userSettingsScreen(Model model) {
|
||||
return "admin/accountsettings";
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "org/admin/settings/details", method = RequestMethod.GET)
|
||||
public @ResponseBody AppUserData viewUserDetails() {
|
||||
|
||||
return this.commonRestOperations.retrieveCurrentUser();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "org/admin/settings/details", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier updateUserDetails(HttpServletRequest request,
|
||||
@RequestParam(value="username", required=false) String username,
|
||||
@RequestParam(value="firstname", required=false) String firstname,
|
||||
@RequestParam(value="lastname", required=false) String lastname,
|
||||
@RequestParam(value="email", required=false) String email) {
|
||||
|
||||
UserCommand command = new UserCommand(username, firstname, lastname, email);
|
||||
|
||||
return this.commonRestOperations.updateCurrentUserDetails(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "org/admin/settings/password", method = RequestMethod.GET)
|
||||
public @ResponseBody ChangePasswordCommand viewChangePasswordDetails() {
|
||||
|
||||
return new ChangePasswordCommand();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "org/admin/settings/password", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier updateUserDetails(HttpServletRequest request,
|
||||
@RequestParam(value="password", required=false) String password,
|
||||
@RequestParam(value="passwordrepeat", required=false) String passwordrepeat) {
|
||||
|
||||
ChangePasswordCommand command = new ChangePasswordCommand();
|
||||
command.setPassword(password);
|
||||
command.setPasswordrepeat(passwordrepeat);
|
||||
|
||||
return this.commonRestOperations.updateCurrentUserPassword(command);
|
||||
}
|
||||
}
|
||||
+180
@@ -0,0 +1,180 @@
|
||||
package org.mifosng.ui.client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
import org.mifosng.data.ClientData;
|
||||
import org.mifosng.data.ClientDataWithAccountsData;
|
||||
import org.mifosng.data.ClientList;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.mifosng.data.LoanAccountData;
|
||||
import org.mifosng.data.NoteData;
|
||||
import org.mifosng.data.command.EnrollClientCommand;
|
||||
import org.mifosng.data.command.NoteCommand;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.mifosng.ui.loanproduct.ClientValidationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Controller
|
||||
public class ClientController {
|
||||
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public ClientController(final CommonRestOperations commonRestOperations) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
}
|
||||
|
||||
@ExceptionHandler(ClientValidationException.class)
|
||||
public @ResponseBody Collection<ErrorResponse> validationException(ClientValidationException ex, HttpServletResponse response) {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.setContentType("application/json");
|
||||
|
||||
return ex.getValidationErrors();
|
||||
}
|
||||
|
||||
private LocalDate parseStringToLocalDate(String eventDate, String dateFieldIdentifier) {
|
||||
LocalDate eventLocalDate = null;
|
||||
if (StringUtils.isNotBlank(eventDate)) {
|
||||
try {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
eventLocalDate = DateTimeFormat.forPattern("dd MMMM yyyy").withLocale(locale).parseLocalDate(eventDate.toLowerCase(locale));
|
||||
} catch (IllegalArgumentException e) {
|
||||
List<ErrorResponse> validationErrors = new ArrayList<ErrorResponse>();
|
||||
validationErrors.add(new ErrorResponse("validation.msg.invalid.date.format", dateFieldIdentifier, eventDate));
|
||||
throw new ClientValidationException(validationErrors);
|
||||
}
|
||||
}
|
||||
|
||||
return eventLocalDate;
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/client/{clientId}/note/all", method = RequestMethod.GET)
|
||||
public @ResponseBody List<NoteData> retrieveClientNotes(@PathVariable("clientId") Long clientId) {
|
||||
|
||||
Collection<NoteData> clientNotes = this.commonRestOperations.retrieveClientNotes(clientId);
|
||||
|
||||
return new ArrayList<NoteData>(clientNotes);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/client/{clientId}/note/new", method = RequestMethod.GET)
|
||||
public @ResponseBody NoteData retrieveNewNoteDetails(@PathVariable("clientId") Long clientId) {
|
||||
|
||||
NoteData noteData = new NoteData();
|
||||
noteData.setClientId(clientId);
|
||||
|
||||
return noteData;
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/client/{clientId}/note/new", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier addClientNote(@PathVariable("clientId") Long clientId,
|
||||
@RequestParam(value="note", required=false) String note) {
|
||||
|
||||
NoteCommand command = new NoteCommand();
|
||||
command.setClientId(clientId);
|
||||
command.setNote(note);
|
||||
|
||||
return this.commonRestOperations.addNote(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/client/{clientId}/note/{noteId}", method = RequestMethod.GET)
|
||||
public @ResponseBody NoteData retrieveExistingNoteDetails(@PathVariable("clientId") Long clientId, @PathVariable("noteId") Long noteId) {
|
||||
|
||||
return this.commonRestOperations.retrieveClientNote(clientId, noteId);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/client/{clientId}/note/{noteId}", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier updateClientNote(@PathVariable("clientId") Long clientId, @PathVariable("noteId") Long noteId,
|
||||
@RequestParam(value="note", required=false) String note) {
|
||||
|
||||
NoteCommand command = new NoteCommand();
|
||||
command.setId(noteId);
|
||||
command.setClientId(clientId);
|
||||
command.setNote(note);
|
||||
|
||||
return this.commonRestOperations.updateNote(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/client/all", method = RequestMethod.GET)
|
||||
public @ResponseBody ClientList viewAllClients() {
|
||||
|
||||
return new ClientList(this.commonRestOperations.retrieveAllIndividualClients());
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/client/new", method = RequestMethod.GET)
|
||||
public @ResponseBody ClientData newIndividualClientDetails() {
|
||||
|
||||
ClientData clientData = this.commonRestOperations.retrieveNewIndividualClient();
|
||||
return clientData;
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/client/new", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier createClient(HttpServletRequest request,
|
||||
@RequestParam(value="office", required=false) Long officeId,
|
||||
@RequestParam(value="firstname", required=false) String firstname,
|
||||
@RequestParam(value="lastname", required=false) String lastname,
|
||||
@RequestParam(value="fullname", required=false) String fullname,
|
||||
@RequestParam(value="joiningDate", required=false) String joiningDate,
|
||||
@RequestParam(value="externalId", required=false) String externalId) {
|
||||
|
||||
|
||||
LocalDate joiningLocalDate = parseStringToLocalDate(joiningDate, "joiningDate");
|
||||
|
||||
EnrollClientCommand command = new EnrollClientCommand(firstname, lastname, fullname, officeId, joiningLocalDate);
|
||||
return this.commonRestOperations.enrollClient(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/client/{clientId}", method = RequestMethod.GET)
|
||||
public @ResponseBody ClientDataWithAccountsData viewClientAccountData(@PathVariable("clientId") Long clientId) {
|
||||
|
||||
return this.commonRestOperations.retrieveClientAccount(clientId);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/loan/{loanId}", method = RequestMethod.GET)
|
||||
public @ResponseBody LoanAccountData viewLoanAccountData(@PathVariable("loanId") Long loanId) {
|
||||
|
||||
return this.commonRestOperations.retrieveLoanAccount(loanId);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/portfolio/client/{clientId}", method = RequestMethod.GET)
|
||||
public String viewClientAccount(final Model model, @PathVariable("clientId") final Long clientId) {
|
||||
|
||||
ClientData clientData = this.commonRestOperations.retrieveClientDetails(clientId);
|
||||
|
||||
model.addAttribute("clientId", clientId);
|
||||
model.addAttribute("clientDisplayName", clientData.getDisplayName());
|
||||
|
||||
return "client/viewClientAccount";
|
||||
}
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package org.mifosng.ui.client;
|
||||
|
||||
public class DropdownOption {
|
||||
|
||||
private String label;
|
||||
private String value;
|
||||
|
||||
public static DropdownOption of(String label, String value) {
|
||||
DropdownOption option = new DropdownOption();
|
||||
option.setLabel(label);
|
||||
option.setValue(value);
|
||||
return option;
|
||||
}
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
package org.mifosng.ui.client;
|
||||
|
||||
import org.joda.time.DateTime;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
public class PayoffFormBean {
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private DateTime payoffDate = new DateTime();
|
||||
|
||||
public DateTime getPayoffDate() {
|
||||
return this.payoffDate;
|
||||
}
|
||||
|
||||
public void setPayoffDate(final DateTime payoffDate) {
|
||||
this.payoffDate = payoffDate;
|
||||
}
|
||||
}
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
package org.mifosng.ui.configuration;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.mifosng.configuration.ApplicationConfigurationService;
|
||||
import org.mifosng.configuration.OAuthProviderDetails;
|
||||
import org.mifosng.data.ConfigurationData;
|
||||
import org.mifosng.data.CurrencyData;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.mifosng.data.command.UpdateOrganisationCurrencyCommand;
|
||||
import org.mifosng.oauth.RefreshableProtectedResourceDetailsService;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.mifosng.ui.loanproduct.ClientValidationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.security.oauth.consumer.ProtectedResourceDetailsService;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.validation.BindingResult;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
import org.springframework.web.bind.annotation.SessionAttributes;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@SessionAttributes({"oauthSettingsFormBean"})
|
||||
@Controller
|
||||
public class ConfigurationController {
|
||||
|
||||
private final ApplicationConfigurationService applicationConfigurationService;
|
||||
private final RefreshableProtectedResourceDetailsService refreshableProtectedResourceDetailsService;
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public ConfigurationController(
|
||||
final CommonRestOperations commonRestOperations, final ApplicationConfigurationService applicationConfigurationService,
|
||||
final RefreshableProtectedResourceDetailsService refreshableProtectedResourceDetailsService) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
this.applicationConfigurationService = applicationConfigurationService;
|
||||
this.refreshableProtectedResourceDetailsService = refreshableProtectedResourceDetailsService;
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
}
|
||||
|
||||
@ExceptionHandler(ClientValidationException.class)
|
||||
public @ResponseBody
|
||||
Collection<ErrorResponse> validationException(ClientValidationException ex,
|
||||
HttpServletResponse response) {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.setContentType("application/json");
|
||||
|
||||
return ex.getValidationErrors();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "org/configuration/edit", method = RequestMethod.GET)
|
||||
public @ResponseBody ConfigurationData viewConfigurationDetails() {
|
||||
|
||||
List<CurrencyData> selectedCurrencyOptions = new ArrayList<CurrencyData>(this.commonRestOperations.retrieveAllowedCurrencies());
|
||||
List<CurrencyData> currencyOptions = new ArrayList<CurrencyData>(this.commonRestOperations.retrieveAllPlatformCurrencies());
|
||||
|
||||
// remove selected currency options
|
||||
currencyOptions.removeAll(selectedCurrencyOptions);
|
||||
|
||||
ConfigurationData configurationData = new ConfigurationData();
|
||||
configurationData.setCurrencyOptions(currencyOptions);
|
||||
configurationData.setSelectedCurrencyOptions(selectedCurrencyOptions);
|
||||
|
||||
return configurationData;
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "org/configuration/edit", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier updateOrganisationCurrencies(@RequestParam(value="selectedItems", required=false) String[] selectedCurrencies) {
|
||||
|
||||
List<String> codes = new ArrayList<String>();
|
||||
if (selectedCurrencies != null) {
|
||||
codes = Arrays.asList(selectedCurrencies);
|
||||
}
|
||||
|
||||
UpdateOrganisationCurrencyCommand command = new UpdateOrganisationCurrencyCommand(codes);
|
||||
|
||||
this.commonRestOperations.updateOrganisationCurrencies(command);
|
||||
|
||||
return new EntityIdentifier(Long.valueOf(1));
|
||||
}
|
||||
|
||||
@ModelAttribute("oauthSettingsFormBean")
|
||||
@RequestMapping(value = "oauth/configuration/edit", method = RequestMethod.GET)
|
||||
public ModelAndView showOAuthConfiguration() {
|
||||
|
||||
OAuthProviderDetails details = this.applicationConfigurationService.retrieveOAuthProviderDetails();
|
||||
|
||||
OauthSettingsFormBean oauthSettingsFormBean = new OauthSettingsFormBean();
|
||||
oauthSettingsFormBean.setConsumerkey(details.getConsumerkey());
|
||||
oauthSettingsFormBean.setSharedSecret(details.getSharedSecret());
|
||||
oauthSettingsFormBean.setOauthProviderUrl(details.getProviderBaseUrl());
|
||||
|
||||
return new ModelAndView("configuration/oauthconfig",
|
||||
"oauthSettingsFormBean", oauthSettingsFormBean);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "oauth/configuration/edit", method = RequestMethod.POST)
|
||||
public ModelAndView updateOAuthConfiguration(
|
||||
@ModelAttribute final OauthSettingsFormBean oauthSettingsFormBean,
|
||||
final BindingResult result) {
|
||||
|
||||
ModelAndView mav = new ModelAndView("redirect:/");
|
||||
|
||||
OAuthProviderDetails newDetails = new OAuthProviderDetails(oauthSettingsFormBean.getOauthProviderUrl(), oauthSettingsFormBean.getConsumerkey(), oauthSettingsFormBean.getSharedSecret());
|
||||
|
||||
this.applicationConfigurationService.update(newDetails);
|
||||
|
||||
this.refreshableProtectedResourceDetailsService.refresh();
|
||||
|
||||
this.commonRestOperations.updateProtectedResource(((ProtectedResourceDetailsService)refreshableProtectedResourceDetailsService).loadProtectedResourceDetailsById("protectedMifosNgServices"));
|
||||
|
||||
return mav;
|
||||
}
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package org.mifosng.ui.configuration;
|
||||
|
||||
public class OauthSettingsFormBean {
|
||||
|
||||
private String oauthProviderUrl;
|
||||
private String sharedSecret;
|
||||
private String consumerkey;
|
||||
|
||||
public String getOauthProviderUrl() {
|
||||
return oauthProviderUrl;
|
||||
}
|
||||
|
||||
public void setOauthProviderUrl(String oauthProviderUrl) {
|
||||
this.oauthProviderUrl = oauthProviderUrl;
|
||||
}
|
||||
|
||||
public String getSharedSecret() {
|
||||
return sharedSecret;
|
||||
}
|
||||
|
||||
public void setSharedSecret(String sharedSecret) {
|
||||
this.sharedSecret = sharedSecret;
|
||||
}
|
||||
|
||||
public String getConsumerkey() {
|
||||
return consumerkey;
|
||||
}
|
||||
|
||||
public void setConsumerkey(String consumerkey) {
|
||||
this.consumerkey = consumerkey;
|
||||
}
|
||||
}
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
package org.mifosng.ui.extradata;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.mifosng.data.ExtraDatasets;
|
||||
import org.mifosng.data.reports.GenericResultset;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.mifosng.ui.loanproduct.ClientValidationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Controller
|
||||
public class ExtraDataController {
|
||||
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public ExtraDataController(final CommonRestOperations commonRestOperations) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
}
|
||||
|
||||
@ExceptionHandler(ClientValidationException.class)
|
||||
public @ResponseBody Collection<ErrorResponse> validationException(ClientValidationException ex, HttpServletResponse response) {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.setContentType("application/json");
|
||||
|
||||
return ex.getValidationErrors();
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/extradata/datasets/{datasetType}", method = RequestMethod.GET)
|
||||
public @ResponseBody ExtraDatasets retrieveExtraDatasets(@PathVariable("datasetType") String datasetType) {
|
||||
|
||||
return this.commonRestOperations.retrieveExtraDatasets(datasetType);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/extradata/{datasetType}/{datasetName}/{datasetPKValue}", method = RequestMethod.GET)
|
||||
public @ResponseBody GenericResultset viewExtraData(@PathVariable("datasetType") String datasetType, @PathVariable("datasetName") String datasetName, @PathVariable("datasetPKValue") String datasetPKValue) {
|
||||
|
||||
return this.commonRestOperations.retrieveExtraData(datasetType, datasetName, datasetPKValue);
|
||||
}
|
||||
|
||||
@RequestMapping(produces="application/json", value = "/extradata/{datasetType}/{datasetName}/{datasetPKValue}", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier saveExtraData(HttpServletRequest request, @PathVariable("datasetType") String datasetType,@PathVariable("datasetName") String datasetName, @PathVariable("datasetPKValue") String datasetPKValue) {
|
||||
return this.commonRestOperations.saveExtraData(datasetType, datasetName, datasetPKValue, request.getParameterMap());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package org.mifosng.ui.home;
|
||||
|
||||
import org.mifosng.ui.reporting.ReportingRestOperations;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Controller
|
||||
public class HomeController {
|
||||
|
||||
private final ReportingRestOperations reportingRestOperations;
|
||||
|
||||
@Autowired
|
||||
public HomeController(final ReportingRestOperations reportingRestOperations) {
|
||||
this.reportingRestOperations = reportingRestOperations;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/forceOAuth", method = RequestMethod.GET)
|
||||
public String forceOAuth() {
|
||||
|
||||
this.reportingRestOperations.hackToForceAuthentication();
|
||||
|
||||
return "redirect:/home";
|
||||
}
|
||||
|
||||
@RequestMapping(value="/", method = RequestMethod.GET)
|
||||
public String redirectToIndexPage() {
|
||||
return "redirect:/home";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/home", method = RequestMethod.GET)
|
||||
public ModelAndView showIndividualClientsOnHomePage() {
|
||||
return new ModelAndView("/home");
|
||||
}
|
||||
|
||||
@RequestMapping(value="/switchToClient", method = RequestMethod.POST)
|
||||
public String switchToClientView(@RequestParam("client") final Long client) {
|
||||
return "redirect:/portfolio/client/" + client;
|
||||
}
|
||||
}
|
||||
+64
@@ -0,0 +1,64 @@
|
||||
package org.mifosng.ui.home;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.mifosng.configuration.ApplicationConfigurationService;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.oauth.consumer.OAuthConsumerToken;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContext;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContextHolder;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@Controller
|
||||
public class LogoutController {
|
||||
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
// private final ApplicationConfigurationService applicationConfigurationService;
|
||||
|
||||
@Autowired
|
||||
public LogoutController(final CommonRestOperations commonRestOperations,
|
||||
ApplicationConfigurationService applicationConfigurationService) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
// this.applicationConfigurationService = applicationConfigurationService;
|
||||
}
|
||||
|
||||
@RequestMapping(value="/logoutcontroller", method = RequestMethod.GET)
|
||||
public String forceOAuth() {
|
||||
|
||||
// OAuthProviderDetails oauthDetails = this.applicationConfigurationService
|
||||
// .retrieveOAuthProviderDetails();
|
||||
|
||||
String resourceId = "protectedMifosNgServices";
|
||||
OAuthSecurityContext context = OAuthSecurityContextHolder.getContext();
|
||||
if (context == null) {
|
||||
throw new IllegalStateException(
|
||||
"No OAuth security context has been established. Unable to access resource '"
|
||||
+ resourceId + "'.");
|
||||
}
|
||||
|
||||
Map<String, OAuthConsumerToken> accessTokens = context
|
||||
.getAccessTokens();
|
||||
OAuthConsumerToken accessToken = accessTokens == null ? null
|
||||
: accessTokens.get(resourceId);
|
||||
|
||||
// model.addAttribute("baseUrl", oauthDetails.getProviderBaseUrl());
|
||||
// model.addAttribute("consumerKey", oauthDetails.getConsumerkey());
|
||||
// model.addAttribute("consumerSecret", oauthDetails.getSharedSecret());
|
||||
// if (accessToken != null) {
|
||||
// model.addAttribute("accessToken", accessToken.getValue());
|
||||
// model.addAttribute("tokenSecret", accessToken.getSecret());
|
||||
// }
|
||||
|
||||
String oauthToken = "";
|
||||
if (accessToken != null) {
|
||||
oauthToken = accessToken.getValue();
|
||||
}
|
||||
|
||||
this.commonRestOperations.logout(oauthToken);
|
||||
|
||||
return "redirect:/j_spring_security_logout";
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
package org.mifosng.ui.loan;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.CurrencyData;
|
||||
import org.mifosng.data.MoneyData;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@Controller
|
||||
public class CashflowController {
|
||||
|
||||
// private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public CashflowController(final CommonRestOperations commonRestOperations) {
|
||||
// this.commonRestOperations = commonRestOperations;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/portfolio/client/{clientId}/cashflow/new", method = RequestMethod.GET)
|
||||
public String submitNewCashflowAnalysis(@PathVariable("clientId") final Long clientId) {
|
||||
return "redirect:/createCashflowAnalysis?loanId=0&clientId={clientId}";
|
||||
}
|
||||
|
||||
// called from webflow
|
||||
public void populateLoanDetailsForCashflow(final CashflowFormBean formBean, Long loanId, Long clientId) {
|
||||
|
||||
formBean.setBusinessName("Fixed Example Business (Sole Trader)");
|
||||
formBean.setClientName("Fixed Example Client");
|
||||
|
||||
CurrencyData currency = new CurrencyData("XOF", "", 0, "CFA", "currency.XOF");
|
||||
MoneyData amount = MoneyData.of(currency, BigDecimal.valueOf(0));
|
||||
|
||||
formBean.setExpectedLoanTerm(12);
|
||||
|
||||
List<MultiTermExpense> investments = new ArrayList<MultiTermExpense>();
|
||||
investments.add(new MultiTermExpense("equipment purchase", Integer.valueOf(0), amount.getAmount(), formBean.getExpectedLoanTerm()));
|
||||
investments.add(new MultiTermExpense("Option two", Integer.valueOf(0), amount.getAmount(), formBean.getExpectedLoanTerm()));
|
||||
investments.add(new MultiTermExpense("Option three", Integer.valueOf(0), amount.getAmount(), formBean.getExpectedLoanTerm()));
|
||||
|
||||
formBean.setInvestments(investments);
|
||||
|
||||
List<OneOffExpense> fixedExpenses = new ArrayList<OneOffExpense>();
|
||||
fixedExpenses.add(new OneOffExpense("Fixed one", amount.getAmount()));
|
||||
fixedExpenses.add(new OneOffExpense("Fixed two", amount.getAmount()));
|
||||
fixedExpenses.add(new OneOffExpense("Fixed three", amount.getAmount()));
|
||||
|
||||
formBean.setFixedExpenses(fixedExpenses);
|
||||
|
||||
List<UnitInformationOfProduct> products = new ArrayList<UnitInformationOfProduct>();
|
||||
products.add(new UnitInformationOfProduct("First Product", Integer.valueOf(10), BigDecimal.valueOf(Double.valueOf("12.00")), BigDecimal.valueOf(Double.valueOf("23.00"))));
|
||||
products.add(new UnitInformationOfProduct("Second Product", Integer.valueOf(500), BigDecimal.valueOf(Double.valueOf("10.00")), BigDecimal.valueOf(Double.valueOf("15.00"))));
|
||||
|
||||
formBean.setProducts(products);
|
||||
// List<ClientReadModel> individualClients = new ArrayList<ClientReadModel>(this.commonRestOperations.retrieveLoan);
|
||||
|
||||
// List<LoanProductReadModel> loanProducts = new ArrayList<LoanProductReadModel>(
|
||||
// this.commonRestOperations.retrieveAllLoanProducts());
|
||||
//
|
||||
// loanFormBean.setApplicantOptions(individualClients);
|
||||
// if (individualClients.size() == 1) {
|
||||
// loanFormBean.setSelectedApplicantOption(individualClients.get(0)
|
||||
// .getId());
|
||||
// }
|
||||
//
|
||||
// loanFormBean.setLoanProductOptions(loanProducts);
|
||||
// if (loanProducts.size() == 1) {
|
||||
// loanFormBean.setSelectedLoanProductOption(loanProducts.get(0)
|
||||
// .getId());
|
||||
// }
|
||||
}
|
||||
}
|
||||
+76
@@ -0,0 +1,76 @@
|
||||
package org.mifosng.ui.loan;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CashflowFormBean implements Serializable {
|
||||
|
||||
private String clientName;
|
||||
private String businessName;
|
||||
|
||||
private Integer expectedLoanTerm = Integer.valueOf(12);
|
||||
|
||||
private List<MultiTermExpense> investments = new ArrayList<MultiTermExpense>();
|
||||
private List<OneOffExpense> fixedExpenses = new ArrayList<OneOffExpense>();
|
||||
|
||||
private List<UnitInformationOfProduct> products = new ArrayList<UnitInformationOfProduct>();
|
||||
|
||||
private Number entrepreneurInput = Double.valueOf("0");
|
||||
|
||||
public String getClientName() {
|
||||
return clientName;
|
||||
}
|
||||
|
||||
public void setClientName(String clientName) {
|
||||
this.clientName = clientName;
|
||||
}
|
||||
|
||||
public String getBusinessName() {
|
||||
return businessName;
|
||||
}
|
||||
|
||||
public void setBusinessName(String businessName) {
|
||||
this.businessName = businessName;
|
||||
}
|
||||
|
||||
public List<OneOffExpense> getFixedExpenses() {
|
||||
return fixedExpenses;
|
||||
}
|
||||
|
||||
public void setFixedExpenses(List<OneOffExpense> fixedExpenses) {
|
||||
this.fixedExpenses = fixedExpenses;
|
||||
}
|
||||
|
||||
public List<UnitInformationOfProduct> getProducts() {
|
||||
return products;
|
||||
}
|
||||
|
||||
public void setProducts(List<UnitInformationOfProduct> products) {
|
||||
this.products = products;
|
||||
}
|
||||
|
||||
public Integer getExpectedLoanTerm() {
|
||||
return expectedLoanTerm;
|
||||
}
|
||||
|
||||
public void setExpectedLoanTerm(Integer expectedLoanTerm) {
|
||||
this.expectedLoanTerm = expectedLoanTerm;
|
||||
}
|
||||
|
||||
public List<MultiTermExpense> getInvestments() {
|
||||
return investments;
|
||||
}
|
||||
|
||||
public void setInvestments(List<MultiTermExpense> investments) {
|
||||
this.investments = investments;
|
||||
}
|
||||
|
||||
public Number getEntrepreneurInput() {
|
||||
return entrepreneurInput;
|
||||
}
|
||||
|
||||
public void setEntrepreneurInput(Number entrepreneurInput) {
|
||||
this.entrepreneurInput = entrepreneurInput;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
package org.mifosng.ui.loan;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.security.Principal;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.mifosng.data.LoanSchedule;
|
||||
import org.mifosng.data.NewLoanWorkflowStepOneData;
|
||||
import org.mifosng.data.command.CalculateLoanScheduleCommand;
|
||||
import org.mifosng.data.command.SubmitLoanApplicationCommand;
|
||||
import org.mifosng.oauth.ConsumerUserDetails;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.mifosng.ui.loanproduct.ClientValidationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
public class LoanController {
|
||||
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public LoanController(final CommonRestOperations commonRestOperations) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
}
|
||||
|
||||
@ExceptionHandler(ClientValidationException.class)
|
||||
public @ResponseBody Collection<ErrorResponse> validationException(ClientValidationException ex, HttpServletResponse response) {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.setContentType("application/json");
|
||||
|
||||
return ex.getValidationErrors();
|
||||
}
|
||||
|
||||
private LocalDate parseStringToLocalDate(String eventDate, String dateFieldIdentifier) {
|
||||
LocalDate eventLocalDate = null;
|
||||
if (StringUtils.isNotBlank(eventDate)) {
|
||||
try {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
eventLocalDate = DateTimeFormat.forPattern("dd MMMM yyyy").withLocale(locale).parseLocalDate(eventDate.toLowerCase(locale));
|
||||
} catch (IllegalArgumentException e) {
|
||||
List<ErrorResponse> validationErrors = new ArrayList<ErrorResponse>();
|
||||
validationErrors.add(new ErrorResponse("validation.msg.invalid.date.format", dateFieldIdentifier, eventDate));
|
||||
throw new ClientValidationException(validationErrors);
|
||||
}
|
||||
}
|
||||
|
||||
return eventLocalDate;
|
||||
}
|
||||
|
||||
private BigDecimal parseStringToBigDecimal(String source) {
|
||||
try {
|
||||
BigDecimal number = null;
|
||||
|
||||
if (StringUtils.isNotBlank(source)) {
|
||||
String sourceWithoutSpaces = source.replaceAll(" ", "");
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
NumberFormat format = NumberFormat.getNumberInstance(locale);
|
||||
Number parsedNumber = format.parse(sourceWithoutSpaces);
|
||||
number = BigDecimal.valueOf(Double.valueOf(parsedNumber
|
||||
.doubleValue()));
|
||||
}
|
||||
|
||||
return number;
|
||||
} catch (ParseException e) {
|
||||
List<ErrorResponse> validationErrors = new ArrayList<ErrorResponse>();
|
||||
validationErrors.add(new ErrorResponse("validation.msg.invalid.number.format", "amount", source));
|
||||
throw new ClientValidationException(validationErrors);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/portfolio/client/{clientId}/loan/new", method = RequestMethod.GET)
|
||||
public String loadLoanCreationWorkflow(final Model model, @PathVariable("clientId") final Long clientId, final Principal principal) {
|
||||
|
||||
UsernamePasswordAuthenticationToken authenticationToken = (UsernamePasswordAuthenticationToken) principal;
|
||||
ConsumerUserDetails user = (ConsumerUserDetails) authenticationToken.getPrincipal();
|
||||
if (user.hasNoAuthorityToSumitLoanApplication()) {
|
||||
throw new AccessDeniedException("");
|
||||
}
|
||||
|
||||
model.addAttribute("clientId", clientId);
|
||||
|
||||
return "newloanapplication";
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/client/{clientId}/loan/new", method = RequestMethod.POST)
|
||||
public @ResponseBody EntityIdentifier submitNewLoanApplication(
|
||||
@RequestParam(value="clientId", required=false) Long applicantId,
|
||||
@RequestParam(value="productId", required=false) Long productId,
|
||||
@RequestParam(value="submittedOnDate", required=false) String submittedOnDateStr,
|
||||
@RequestParam(value="submittedOnNote", required=false) String submittedOnNote,
|
||||
@RequestParam(value="currencyCode", required=false) String currencyCode,
|
||||
@RequestParam(value="digitsAfterDecimal", required=false) Integer digitsAfterDecimal,
|
||||
@RequestParam(value="principalMoney", required=false) String principalMoney,
|
||||
@RequestParam(value="repaidEvery", required=false) Integer repaymentEvery,
|
||||
@RequestParam(value="selectedRepaymentFrequencyOption", required=false) Integer repaymentFrequency,
|
||||
@RequestParam(value="numberOfRepayments", required=false) Integer numberOfRepayments,
|
||||
@RequestParam(value="selectedAmortizationMethodOption", required=false) Integer amortizationMethod,
|
||||
@RequestParam(value="inArrearsTolerance", required=false) String inArrearsTolerance,
|
||||
@RequestParam(value="nominalInterestRate", required=false) String nominalInterestRate,
|
||||
@RequestParam(value="selectedInterestFrequencyOption", required=false) Integer interestRateFrequencyMethod,
|
||||
@RequestParam(value="selectedInterestMethodOption", required=false) Integer interestMethod,
|
||||
@RequestParam(value="expectedDisbursementDate", required=false) String expectedDisbursementDateStr,
|
||||
@RequestParam(value="repaymentsStartingFromDate", required=false) String repaymentsStartingFromDateStr,
|
||||
@RequestParam(value="interestCalculatedFromDate", required=false) String interestCalculatedFromDateStr
|
||||
) {
|
||||
|
||||
final LocalDate submittedOnDate = parseStringToLocalDate(submittedOnDateStr, "submittedOnDate");
|
||||
final Number toleranceAmount = parseStringToBigDecimal(inArrearsTolerance);
|
||||
|
||||
final Number principal = parseStringToBigDecimal(principalMoney);
|
||||
final Number interestRatePerPeriod = parseStringToBigDecimal(nominalInterestRate);
|
||||
final boolean flexibleRepaymentSchedule = false;
|
||||
final boolean interestRebateAllowed = false;
|
||||
|
||||
final LocalDate expectedDisbursementDate = parseStringToLocalDate(expectedDisbursementDateStr, "expectedDisbursementDate");
|
||||
final LocalDate repaymentsStartingFromDate = parseStringToLocalDate(repaymentsStartingFromDateStr, "repaymentsStartingFromDate");
|
||||
final LocalDate interestCalculatedFromDate = parseStringToLocalDate(interestCalculatedFromDateStr, "interestCalculatedFromDate");
|
||||
|
||||
CalculateLoanScheduleCommand calculateLoanScheduleCommand = new CalculateLoanScheduleCommand(currencyCode, digitsAfterDecimal, principal, interestRatePerPeriod,
|
||||
interestRateFrequencyMethod, interestMethod, repaymentEvery, repaymentFrequency, numberOfRepayments, amortizationMethod,
|
||||
flexibleRepaymentSchedule, interestRebateAllowed, expectedDisbursementDate, repaymentsStartingFromDate, interestCalculatedFromDate);
|
||||
|
||||
LoanSchedule loanSchedule = this.commonRestOperations.calculateLoanSchedule(calculateLoanScheduleCommand);
|
||||
|
||||
SubmitLoanApplicationCommand command = new SubmitLoanApplicationCommand(applicantId, productId,
|
||||
submittedOnDate, submittedOnNote, expectedDisbursementDate, repaymentsStartingFromDate, interestCalculatedFromDate,
|
||||
loanSchedule, currencyCode, digitsAfterDecimal, principal,
|
||||
interestRatePerPeriod, interestRateFrequencyMethod, interestMethod,
|
||||
repaymentEvery, repaymentFrequency, numberOfRepayments, amortizationMethod,
|
||||
toleranceAmount, flexibleRepaymentSchedule, interestRebateAllowed);
|
||||
|
||||
Long identifier = this.commonRestOperations.submitLoanApplication(command);
|
||||
|
||||
return new EntityIdentifier(identifier);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/loanschedule/calculate", method = RequestMethod.POST)
|
||||
public @ResponseBody LoanSchedule calculateLoanSchedule(
|
||||
@RequestParam(value="currencyCode", required=false) String currencyCode,
|
||||
@RequestParam(value="digitsAfterDecimal", required=false) Integer digitsAfterDecimal,
|
||||
@RequestParam(value="principalMoney", required=false) String principalMoney,
|
||||
@RequestParam(value="repaidEvery", required=false) Integer repaymentEvery,
|
||||
@RequestParam(value="selectedRepaymentFrequencyOption", required=false) Integer repaymentFrequency,
|
||||
@RequestParam(value="numberOfRepayments", required=false) Integer numberOfRepayments,
|
||||
@RequestParam(value="selectedAmortizationMethodOption", required=false) Integer amortizationMethod,
|
||||
@RequestParam(value="nominalInterestRate", required=false) String nominalInterestRate,
|
||||
@RequestParam(value="selectedInterestFrequencyOption", required=false) Integer interestRateFrequencyMethod,
|
||||
@RequestParam(value="selectedInterestMethodOption", required=false) Integer interestMethod,
|
||||
@RequestParam(value="expectedDisbursementDate", required=false) String expectedDisbursementDateStr,
|
||||
@RequestParam(value="repaymentsStartingFromDate", required=false) String repaymentsStartingFromDateStr,
|
||||
@RequestParam(value="interestCalculatedFromDate", required=false) String interestCalculatedFromDateStr
|
||||
) {
|
||||
|
||||
final Number principal = parseStringToBigDecimal(principalMoney);
|
||||
final Number interestRatePerPeriod = parseStringToBigDecimal(nominalInterestRate);
|
||||
final boolean flexibleRepaymentSchedule = false;
|
||||
final boolean interestRebateAllowed = false;
|
||||
final LocalDate expectedDisbursementDate = parseStringToLocalDate(expectedDisbursementDateStr, "expectedDisbursementDate");
|
||||
final LocalDate repaymentsStartingFromDate = parseStringToLocalDate(repaymentsStartingFromDateStr, "repaymentsStartingFromDate");
|
||||
final LocalDate interestCalculatedFromDate = parseStringToLocalDate(interestCalculatedFromDateStr, "interestCalculatedFromDate");
|
||||
|
||||
CalculateLoanScheduleCommand command = new CalculateLoanScheduleCommand(currencyCode, digitsAfterDecimal, principal, interestRatePerPeriod,
|
||||
interestRateFrequencyMethod, interestMethod, repaymentEvery, repaymentFrequency, numberOfRepayments, amortizationMethod,
|
||||
flexibleRepaymentSchedule, interestRebateAllowed, expectedDisbursementDate, repaymentsStartingFromDate, interestCalculatedFromDate);
|
||||
|
||||
return this.commonRestOperations.calculateLoanSchedule(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/client/{clientId}/product/{productId}/new", method = RequestMethod.GET)
|
||||
public @ResponseBody NewLoanWorkflowStepOneData retrieveNewLoan(@PathVariable("clientId") Long clientId, @PathVariable("productId") Long productId) {
|
||||
|
||||
return this.commonRestOperations.retrieveNewLoanApplicationDetails(clientId, productId);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/client/{clientId}/loan/new/workflow/one", method = RequestMethod.GET)
|
||||
public @ResponseBody NewLoanWorkflowStepOneData retrieveNewLoan(@PathVariable("clientId") Long clientId) {
|
||||
|
||||
return this.commonRestOperations.retrieveNewLoanApplicationStepOneDetails(clientId);
|
||||
}
|
||||
}
|
||||
+251
@@ -0,0 +1,251 @@
|
||||
package org.mifosng.ui.loan;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.mifosng.data.LoanRepaymentData;
|
||||
import org.mifosng.data.command.AdjustLoanTransactionCommand;
|
||||
import org.mifosng.data.command.LoanStateTransitionCommand;
|
||||
import org.mifosng.data.command.LoanTransactionCommand;
|
||||
import org.mifosng.data.command.UndoLoanApprovalCommand;
|
||||
import org.mifosng.data.command.UndoLoanDisbursalCommand;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.mifosng.ui.loanproduct.ClientValidationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Controller
|
||||
public class LoanTransactionController {
|
||||
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public LoanTransactionController(final CommonRestOperations commonRestOperations) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
}
|
||||
|
||||
@ExceptionHandler(ClientValidationException.class)
|
||||
public @ResponseBody Collection<ErrorResponse> validationException(ClientValidationException ex, HttpServletResponse response) {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.setContentType("application/json");
|
||||
|
||||
return ex.getValidationErrors();
|
||||
}
|
||||
|
||||
private LocalDate parseStringToLocalDate(String eventDate, String dateFieldIdentifier) {
|
||||
LocalDate eventLocalDate = null;
|
||||
if (StringUtils.isNotBlank(eventDate)) {
|
||||
try {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
eventLocalDate = DateTimeFormat.forPattern("dd MMMM yyyy").withLocale(locale).parseLocalDate(eventDate.toLowerCase(locale));
|
||||
} catch (IllegalArgumentException e) {
|
||||
List<ErrorResponse> validationErrors = new ArrayList<ErrorResponse>();
|
||||
validationErrors.add(new ErrorResponse("validation.msg.invalid.date.format", dateFieldIdentifier, eventDate));
|
||||
throw new ClientValidationException(validationErrors);
|
||||
}
|
||||
}
|
||||
|
||||
return eventLocalDate;
|
||||
}
|
||||
|
||||
private BigDecimal parseStringToBigDecimal(String source) {
|
||||
try {
|
||||
BigDecimal number = null;
|
||||
|
||||
if (StringUtils.isNotBlank(source)) {
|
||||
String sourceWithoutSpaces = source.replaceAll(" ", "");
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
NumberFormat format = NumberFormat.getNumberInstance(locale);
|
||||
Number parsedNumber = format.parse(sourceWithoutSpaces);
|
||||
number = BigDecimal.valueOf(Double.valueOf(parsedNumber
|
||||
.doubleValue()));
|
||||
}
|
||||
|
||||
return number;
|
||||
} catch (ParseException e) {
|
||||
List<ErrorResponse> validationErrors = new ArrayList<ErrorResponse>();
|
||||
validationErrors.add(new ErrorResponse("validation.msg.invalid.number.format", "amount", source));
|
||||
throw new ClientValidationException(validationErrors);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/portfolio/loan/{loanId}/delete", method = RequestMethod.POST)
|
||||
public @ResponseBody EntityIdentifier deleteLoan(@PathVariable("loanId") final Long loanId) {
|
||||
|
||||
return this.commonRestOperations.deleteLoan(loanId);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/loan/{loanId}/approve", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier approveLoan(
|
||||
@PathVariable("loanId") final Long loanId,
|
||||
@RequestParam(value="eventDate", required=false) String eventDate,
|
||||
@RequestParam(value="comment", required=false) String comment) {
|
||||
|
||||
LocalDate approvalDate = parseStringToLocalDate(eventDate, "eventDate");
|
||||
|
||||
LoanStateTransitionCommand command = new LoanStateTransitionCommand(loanId, approvalDate, comment);
|
||||
|
||||
return this.commonRestOperations.approveLoan(command);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/portfolio/loan/{loanId}/undoapproval", method = RequestMethod.POST)
|
||||
public String undoLoanApproval(@PathVariable("loanId") final Long loanId) {
|
||||
|
||||
UndoLoanApprovalCommand command = new UndoLoanApprovalCommand(loanId);
|
||||
|
||||
EntityIdentifier clientAccountId = this.commonRestOperations
|
||||
.undoLoanApproval(command);
|
||||
|
||||
return "redirect:/portfolio/client/" + clientAccountId.getEntityId();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/loan/{loanId}/reject", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier rejectLoan(
|
||||
@PathVariable("loanId") final Long loanId,
|
||||
@RequestParam(value="eventDate", required=false) String eventDate,
|
||||
@RequestParam(value="comment", required=false) String comment) {
|
||||
|
||||
LocalDate rejectionDate = parseStringToLocalDate(eventDate, "eventDate");
|
||||
|
||||
LoanStateTransitionCommand command = new LoanStateTransitionCommand(loanId, rejectionDate, comment);
|
||||
|
||||
return this.commonRestOperations.rejectLoan(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/loan/{loanId}/withdraw", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier loanWithdrawnByClient(
|
||||
@PathVariable("loanId") final Long loanId,
|
||||
@RequestParam(value="eventDate", required=false) String eventDate,
|
||||
@RequestParam(value="comment", required=false) String comment) {
|
||||
|
||||
LocalDate withdrawnOnDate = parseStringToLocalDate(eventDate, "eventDate");
|
||||
|
||||
LoanStateTransitionCommand command = new LoanStateTransitionCommand(loanId, withdrawnOnDate, comment);
|
||||
|
||||
return this.commonRestOperations.withdrawLoan(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/loan/{loanId}/disburse", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier disburseLoan(
|
||||
@PathVariable("loanId") final Long loanId,
|
||||
@RequestParam(value="eventDate", required=false) String eventDate,
|
||||
@RequestParam(value="comment", required=false) String comment) {
|
||||
|
||||
LocalDate disbursalDate = parseStringToLocalDate(eventDate, "eventDate");
|
||||
|
||||
LoanStateTransitionCommand command = new LoanStateTransitionCommand(loanId, disbursalDate, comment);
|
||||
|
||||
return this.commonRestOperations.disburseLoan(command);
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/portfolio/loan/{loanId}/undodisbursal", method = RequestMethod.POST)
|
||||
public String undoLoanDisbursal(@PathVariable final Long loanId) {
|
||||
|
||||
UndoLoanDisbursalCommand command = new UndoLoanDisbursalCommand(loanId);
|
||||
|
||||
EntityIdentifier clientAccountId = this.commonRestOperations
|
||||
.undloLoanDisbursal(command);
|
||||
|
||||
return "redirect:/portfolio/client/" + clientAccountId.getEntityId();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value ="/portfolio/loan/{loanId}/repayment", method = RequestMethod.GET)
|
||||
public @ResponseBody LoanRepaymentData retrieveNewLoanRepaymentDetail(@PathVariable("loanId") final Long loanId) {
|
||||
|
||||
return this.commonRestOperations.retrieveNewLoanRepaymentDetails(loanId);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/loan/{loanId}/repayment", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier enterRepaymentOnLoan(
|
||||
@PathVariable("loanId") final Long loanId,
|
||||
@RequestParam(value="transactionDate", required=false) String transactionDate,
|
||||
@RequestParam(value="transactionComment", required=false) String transactionComment,
|
||||
@RequestParam(value="transactionAmount", required=false) String transactionAmount) {
|
||||
|
||||
LocalDate repaymentDate = parseStringToLocalDate(transactionDate, "transactionDate");
|
||||
BigDecimal repaymentAmount = parseStringToBigDecimal(transactionAmount);
|
||||
|
||||
LoanTransactionCommand command = new LoanTransactionCommand(loanId,
|
||||
repaymentDate, transactionComment, repaymentAmount);
|
||||
|
||||
return this.commonRestOperations.makeLoanRepayment(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/loan/{loanId}/repayment/{repaymentId}/adjust", method = RequestMethod.GET)
|
||||
public @ResponseBody LoanRepaymentData retrieveLoanRepayment(@PathVariable("loanId") final Long loanId, @PathVariable("repaymentId") final Long repaymentId) {
|
||||
return this.commonRestOperations.retrieveLoanRepaymentDetails(loanId, repaymentId);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/loan/{loanId}/repayment/{repaymentId}/adjust", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier adjustPreviousRepaymentOnLoan(
|
||||
@PathVariable("loanId") final Long loanId, @PathVariable("repaymentId") final Long repaymentId,
|
||||
@RequestParam(value="transactionDate", required=false) String transactionDate,
|
||||
@RequestParam(value="transactionComment", required=false) String transactionComment,
|
||||
@RequestParam(value="transactionAmount", required=false) String transactionAmount) {
|
||||
|
||||
LocalDate repaymentDate = parseStringToLocalDate(transactionDate, "transactionDate");
|
||||
BigDecimal repaymentAmount = parseStringToBigDecimal(transactionAmount);
|
||||
|
||||
AdjustLoanTransactionCommand command = new AdjustLoanTransactionCommand(loanId, repaymentId, repaymentDate, transactionComment, repaymentAmount);
|
||||
|
||||
return this.commonRestOperations.adjustLoanRepayment(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/loan/{loanId}/waive", method = RequestMethod.GET)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody LoanRepaymentData retrievePossibleWaiveDetails(@PathVariable("loanId") final Long loanId) {
|
||||
return this.commonRestOperations.retrieveNewLoanWaiverDetails(loanId);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/loan/{loanId}/waive", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier waiveLoanAmount(
|
||||
@PathVariable("loanId") final Long loanId,
|
||||
@RequestParam(value="transactionDate", required=false) String transactionDate,
|
||||
@RequestParam(value="transactionComment", required=false) String transactionComment,
|
||||
@RequestParam(value="transactionAmount", required=false) String transactionAmount) {
|
||||
|
||||
LocalDate waiveDate = parseStringToLocalDate(transactionDate, "transactionDate");
|
||||
BigDecimal waiveAmount = parseStringToBigDecimal(transactionAmount);
|
||||
|
||||
LoanTransactionCommand command = new LoanTransactionCommand(loanId,
|
||||
waiveDate, transactionComment, waiveAmount);
|
||||
|
||||
return this.commonRestOperations.waiveLoanAmount(command);
|
||||
}
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package org.mifosng.ui.loan;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
|
||||
public class MultiTermExpense implements Serializable {
|
||||
|
||||
private String name;
|
||||
private String description;
|
||||
private Integer fullTermInMonths;
|
||||
private Number fullAmount;
|
||||
private Integer applicableTermInMonths;
|
||||
private Number applicableAmount;
|
||||
|
||||
public MultiTermExpense() {
|
||||
//
|
||||
}
|
||||
|
||||
public MultiTermExpense(String name, Integer fullTermInMonths, BigDecimal fullAmount, Integer applicableTermInMonths) {
|
||||
this.name = name;
|
||||
this.fullTermInMonths = fullTermInMonths;
|
||||
this.fullAmount = fullAmount;
|
||||
this.applicableTermInMonths = applicableTermInMonths;
|
||||
this.applicableAmount = fullAmount;
|
||||
BigDecimal fullAmountAsDecimal = BigDecimal.valueOf(this.fullAmount.longValue());
|
||||
if (!fullAmountAsDecimal.equals(BigDecimal.ZERO)) {
|
||||
this.applicableAmount = fullAmountAsDecimal.divide(BigDecimal.valueOf(applicableTermInMonths.longValue()), RoundingMode.HALF_EVEN);
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Integer getFullTermInMonths() {
|
||||
return fullTermInMonths;
|
||||
}
|
||||
|
||||
public void setFullTermInMonths(Integer fullTermInMonths) {
|
||||
this.fullTermInMonths = fullTermInMonths;
|
||||
}
|
||||
|
||||
public Number getFullAmount() {
|
||||
return fullAmount;
|
||||
}
|
||||
|
||||
public void setFullAmount(Number fullAmount) {
|
||||
this.fullAmount = fullAmount;
|
||||
}
|
||||
|
||||
public Integer getApplicableTermInMonths() {
|
||||
return applicableTermInMonths;
|
||||
}
|
||||
|
||||
public void setApplicableTermInMonths(Integer applicableTermInMonths) {
|
||||
this.applicableTermInMonths = applicableTermInMonths;
|
||||
}
|
||||
|
||||
public Number getApplicableAmount() {
|
||||
return applicableAmount;
|
||||
}
|
||||
|
||||
public void setApplicableAmount(Number applicableAmount) {
|
||||
this.applicableAmount = applicableAmount;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package org.mifosng.ui.loan;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class OneOffExpense implements Serializable {
|
||||
|
||||
private String name;
|
||||
private String description;
|
||||
private Number amount;
|
||||
|
||||
public OneOffExpense() {
|
||||
//
|
||||
}
|
||||
|
||||
public OneOffExpense(String name, BigDecimal amount) {
|
||||
this.name = name;
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Number getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(Number amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package org.mifosng.ui.loan;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class UnitInformationOfProduct implements Serializable {
|
||||
|
||||
private String name;
|
||||
private Number unitsSold = Integer.valueOf(0);
|
||||
private Number costPerUnit = BigDecimal.ZERO;
|
||||
private Number pricePerUnit = BigDecimal.ZERO;
|
||||
|
||||
public UnitInformationOfProduct() {
|
||||
//
|
||||
}
|
||||
|
||||
public UnitInformationOfProduct(String name, Integer unitsSold,
|
||||
BigDecimal costPerUnit, BigDecimal pricePerUnit) {
|
||||
this.name = name;
|
||||
this.unitsSold = unitsSold;
|
||||
this.costPerUnit = costPerUnit;
|
||||
this.pricePerUnit = pricePerUnit;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Number getUnitsSold() {
|
||||
return unitsSold;
|
||||
}
|
||||
|
||||
public void setUnitsSold(Number unitsSold) {
|
||||
this.unitsSold = unitsSold;
|
||||
}
|
||||
|
||||
public Number getCostPerUnit() {
|
||||
return costPerUnit;
|
||||
}
|
||||
|
||||
public void setCostPerUnit(Number costPerUnit) {
|
||||
this.costPerUnit = costPerUnit;
|
||||
}
|
||||
|
||||
public Number getPricePerUnit() {
|
||||
return pricePerUnit;
|
||||
}
|
||||
|
||||
public void setPricePerUnit(Number pricePerUnit) {
|
||||
this.pricePerUnit = pricePerUnit;
|
||||
}
|
||||
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package org.mifosng.ui.loanproduct;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
|
||||
public class ClientValidationException extends RuntimeException {
|
||||
|
||||
private final List<ErrorResponse> validationErrors;
|
||||
|
||||
public ClientValidationException(List<ErrorResponse> validationErrors) {
|
||||
super("Validation errors exist");
|
||||
this.validationErrors = validationErrors;
|
||||
}
|
||||
|
||||
public List<ErrorResponse> getValidationErrors() {
|
||||
return validationErrors;
|
||||
}
|
||||
}
|
||||
+193
@@ -0,0 +1,193 @@
|
||||
package org.mifosng.ui.loanproduct;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.mifosng.data.LoanProductData;
|
||||
import org.mifosng.data.command.CreateLoanProductCommand;
|
||||
import org.mifosng.data.command.UpdateLoanProductCommand;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Controller
|
||||
public class LoanProductController {
|
||||
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public LoanProductController(final CommonRestOperations commonRestOperations) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
}
|
||||
|
||||
@ExceptionHandler(ClientValidationException.class)
|
||||
public @ResponseBody Collection<ErrorResponse> validationException(ClientValidationException ex, HttpServletResponse response) {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.setContentType("application/json");
|
||||
|
||||
return ex.getValidationErrors();
|
||||
}
|
||||
|
||||
private BigDecimal parseStringToBigDecimal(String source) {
|
||||
try {
|
||||
BigDecimal number = null;
|
||||
|
||||
if (StringUtils.isNotBlank(source)) {
|
||||
String sourceWithoutSpaces = source.replaceAll(" ", "");
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
NumberFormat format = NumberFormat.getNumberInstance(locale);
|
||||
Number parsedNumber = format.parse(sourceWithoutSpaces);
|
||||
number = BigDecimal.valueOf(Double.valueOf(parsedNumber
|
||||
.doubleValue()));
|
||||
}
|
||||
|
||||
return number;
|
||||
} catch (ParseException e) {
|
||||
List<ErrorResponse> validationErrors = new ArrayList<ErrorResponse>();
|
||||
validationErrors.add(new ErrorResponse("validation.msg.invalid.number.format", "amount", source));
|
||||
throw new ClientValidationException(validationErrors);
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/product/loan/all", method = RequestMethod.GET)
|
||||
public @ResponseBody Collection<LoanProductData> viewAllLoanProducts() {
|
||||
|
||||
return this.commonRestOperations.retrieveAllLoanProducts();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/product/loan/new", method = RequestMethod.GET)
|
||||
public @ResponseBody LoanProductData viewNewLoanProductForm() {
|
||||
|
||||
return this.commonRestOperations.retrieveNewLoanProductDetails();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/product/loan/new", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier createLoanProduct(HttpServletRequest request,
|
||||
@RequestParam("name") String name,
|
||||
@RequestParam("description") String description,
|
||||
@RequestParam("selectedCurrency") String currencyCode, @RequestParam("selectedDigitsAfterDecimal") Integer digitsAfterDecimal,
|
||||
@RequestParam("amount") String principalAsNumber,
|
||||
@RequestParam("repaidEvery") Integer repaymentEvery,
|
||||
@RequestParam("selectedRepaymentFrequencyOption") Integer repaymentFrequency,
|
||||
@RequestParam("numberOfRepayments") Integer numberOfRepayments,
|
||||
@RequestParam("selectedAmortizationMethodOption") Integer amortizationMethod,
|
||||
@RequestParam("inArrearsTolerance") String inArrearsToleranceAsNumber,
|
||||
@RequestParam("nominalInterestRate") String nominalInterestRatePerPeriodAsNumber,
|
||||
@RequestParam("selectedInterestFrequencyOption") Integer nominalInterestRatePerPeriodFrequency,
|
||||
@RequestParam("selectedInterestMethodOption") Integer interestMethod
|
||||
) {
|
||||
|
||||
CreateLoanProductCommand command = new CreateLoanProductCommand();
|
||||
command.setName(name);
|
||||
command.setDescription(description);
|
||||
command.setCurrencyCode(currencyCode);
|
||||
command.setDigitsAfterDecimal(digitsAfterDecimal);
|
||||
|
||||
if (StringUtils.isNotBlank(principalAsNumber)) {
|
||||
BigDecimal principal = parseStringToBigDecimal(principalAsNumber);
|
||||
command.setPrincipal(principal);
|
||||
}
|
||||
|
||||
command.setRepaymentEvery(repaymentEvery);
|
||||
command.setRepaymentFrequency(repaymentFrequency);
|
||||
command.setNumberOfRepayments(numberOfRepayments);
|
||||
command.setAmortizationMethod(amortizationMethod);
|
||||
|
||||
if (StringUtils.isNotBlank(inArrearsToleranceAsNumber)) {
|
||||
BigDecimal inArrearsToleranceAmount = parseStringToBigDecimal(inArrearsToleranceAsNumber);
|
||||
command.setInArrearsToleranceAmount(inArrearsToleranceAmount);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(nominalInterestRatePerPeriodAsNumber)) {
|
||||
BigDecimal interestRatePerPeriod = parseStringToBigDecimal(nominalInterestRatePerPeriodAsNumber);
|
||||
command.setInterestRatePerPeriod(interestRatePerPeriod);
|
||||
}
|
||||
command.setInterestRateFrequencyMethod(nominalInterestRatePerPeriodFrequency);
|
||||
command.setInterestMethod(interestMethod);
|
||||
|
||||
return this.commonRestOperations.createLoanProduct(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/portfolio/product/loan/{productId}", method = RequestMethod.GET)
|
||||
public @ResponseBody LoanProductData viewLoanProduct(@PathVariable("productId") final Long productId) {
|
||||
|
||||
return this.commonRestOperations.retrieveLoanProductDetails(productId);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/portfolio/product/loan/{productId}", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier updateLoanProduct(@PathVariable("productId") final Long productId, HttpServletRequest request,
|
||||
@RequestParam("name") String name, @RequestParam("description") String description,
|
||||
@RequestParam("selectedCurrency") String currencyCode, @RequestParam("selectedDigitsAfterDecimal") Integer digitsAfterDecimal,
|
||||
@RequestParam("amount") String principalAsNumber,
|
||||
@RequestParam("repaidEvery") Integer repaymentEvery,
|
||||
@RequestParam("selectedRepaymentFrequencyOption") Integer repaymentFrequency,
|
||||
@RequestParam("numberOfRepayments") Integer numberOfRepayments,
|
||||
@RequestParam("selectedAmortizationMethodOption") Integer amortizationMethod,
|
||||
@RequestParam("inArrearsTolerance") String inArrearsToleranceAsNumber,
|
||||
@RequestParam("nominalInterestRate") String nominalInterestRatePerPeriodAsNumber,
|
||||
@RequestParam("selectedInterestFrequencyOption") Integer nominalInterestRatePerPeriodFrequency,
|
||||
@RequestParam("selectedInterestMethodOption") Integer interestMethod
|
||||
) {
|
||||
|
||||
UpdateLoanProductCommand command = new UpdateLoanProductCommand();
|
||||
command.setId(productId);
|
||||
command.setName(name);
|
||||
command.setDescription(description);
|
||||
command.setExternalId(null);
|
||||
command.setCurrencyCode(currencyCode);
|
||||
command.setDigitsAfterDecimal(digitsAfterDecimal);
|
||||
|
||||
if (StringUtils.isNotBlank(principalAsNumber)) {
|
||||
BigDecimal principal = parseStringToBigDecimal(principalAsNumber);
|
||||
command.setPrincipal(principal);
|
||||
}
|
||||
|
||||
command.setRepaymentEvery(repaymentEvery);
|
||||
command.setRepaymentFrequency(repaymentFrequency);
|
||||
command.setNumberOfRepayments(numberOfRepayments);
|
||||
command.setAmortizationMethod(amortizationMethod);
|
||||
|
||||
if (StringUtils.isNotBlank(inArrearsToleranceAsNumber)) {
|
||||
BigDecimal inArrearsToleranceAmount = parseStringToBigDecimal(inArrearsToleranceAsNumber);
|
||||
command.setInArrearsToleranceAmount(inArrearsToleranceAmount);
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(nominalInterestRatePerPeriodAsNumber)) {
|
||||
BigDecimal interestRatePerPeriod = parseStringToBigDecimal(nominalInterestRatePerPeriodAsNumber);
|
||||
command.setInterestRatePerPeriod(interestRatePerPeriod);
|
||||
}
|
||||
command.setInterestRateFrequencyMethod(nominalInterestRatePerPeriodFrequency);
|
||||
command.setInterestMethod(interestMethod);
|
||||
|
||||
return this.commonRestOperations.updateLoanProduct(command);
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package org.mifosng.ui.migration;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import org.mifosng.configuration.ApplicationConfigurationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.oauth.consumer.client.OAuthRestTemplate;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@Controller
|
||||
public class MigrationTriggerController {
|
||||
|
||||
private final OAuthRestTemplate oauthRestServiceTemplate;
|
||||
private final ApplicationConfigurationService applicationConfigurationService;
|
||||
|
||||
@Autowired
|
||||
public MigrationTriggerController(final OAuthRestTemplate oauthRestServiceTemplate, ApplicationConfigurationService applicationConfigurationService) {
|
||||
this.oauthRestServiceTemplate = oauthRestServiceTemplate;
|
||||
this.applicationConfigurationService = applicationConfigurationService;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/migration/trigger/clients/creocore", method = RequestMethod.GET)
|
||||
public String migrateClientInformation() {
|
||||
|
||||
URI restUri = URI
|
||||
.create(getBaseServerUrl().concat("api/protected/import/trigger/clients/creocore"));
|
||||
|
||||
this.oauthRestServiceTemplate.getForEntity(restUri, null);
|
||||
return "redirect:/home";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/migration/trigger/loans/creocore", method = RequestMethod.GET)
|
||||
public String migrateLoanInformation() {
|
||||
|
||||
URI restUri = URI
|
||||
.create(getBaseServerUrl().concat("api/protected/import/trigger/loans/creocore"));
|
||||
|
||||
this.oauthRestServiceTemplate.getForEntity(restUri, null);
|
||||
return "redirect:/home";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/migration/trigger/repayments/creocore", method = RequestMethod.GET)
|
||||
public String migrateLoanRepaymentsInformation() {
|
||||
|
||||
URI restUri = URI
|
||||
.create(getBaseServerUrl().concat("api/protected/import/trigger/repayments/creocore"));
|
||||
|
||||
this.oauthRestServiceTemplate.getForEntity(restUri, null);
|
||||
return "redirect:/home";
|
||||
}
|
||||
|
||||
private String getBaseServerUrl() {
|
||||
return this.applicationConfigurationService.retrieveOAuthProviderDetails().getProviderBaseUrl();
|
||||
}
|
||||
}
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
package org.mifosng.ui.office;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.joda.time.LocalDate;
|
||||
import org.joda.time.format.DateTimeFormat;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.mifosng.data.OfficeData;
|
||||
import org.mifosng.data.command.OfficeCommand;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.mifosng.ui.loanproduct.ClientValidationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.i18n.LocaleContextHolder;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Controller
|
||||
public class OfficeController {
|
||||
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public OfficeController(final CommonRestOperations commonRestOperations) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
}
|
||||
|
||||
@ExceptionHandler(ClientValidationException.class)
|
||||
public @ResponseBody
|
||||
Collection<ErrorResponse> validationException(ClientValidationException ex,
|
||||
HttpServletResponse response) {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.setContentType("application/json");
|
||||
|
||||
return ex.getValidationErrors();
|
||||
}
|
||||
|
||||
private LocalDate parseStringToLocalDate(String eventDate, String dateFieldIdentifier) {
|
||||
LocalDate eventLocalDate = null;
|
||||
if (StringUtils.isNotBlank(eventDate)) {
|
||||
try {
|
||||
Locale locale = LocaleContextHolder.getLocale();
|
||||
eventLocalDate = DateTimeFormat.forPattern("dd MMMM yyyy").withLocale(locale).parseLocalDate(eventDate.toLowerCase(locale));
|
||||
} catch (IllegalArgumentException e) {
|
||||
List<ErrorResponse> validationErrors = new ArrayList<ErrorResponse>();
|
||||
validationErrors.add(new ErrorResponse("validation.msg.invalid.date.format", dateFieldIdentifier, eventDate));
|
||||
throw new ClientValidationException(validationErrors);
|
||||
}
|
||||
}
|
||||
|
||||
return eventLocalDate;
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/org/office/all", method = RequestMethod.GET)
|
||||
public @ResponseBody Collection<OfficeData> viewAllOffices() {
|
||||
|
||||
return this.commonRestOperations.retrieveAllOffices();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/org/office/new", method = RequestMethod.GET)
|
||||
public @ResponseBody OfficeData viewNewOfficeForm() {
|
||||
|
||||
OfficeData newOffice = new OfficeData();
|
||||
newOffice.setOpeningDate(new LocalDate());
|
||||
|
||||
Collection<OfficeData> allOffices = this.commonRestOperations.retrieveAllOffices();
|
||||
List<OfficeData> allowedParents = new ArrayList<OfficeData>(allOffices);
|
||||
|
||||
newOffice.setAllowedParents(allowedParents);
|
||||
|
||||
return newOffice;
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/org/office/new", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier createOffice(HttpServletRequest request,
|
||||
@RequestParam("name") String name,
|
||||
@RequestParam(value="parentId", required=false) Long parentId,
|
||||
@RequestParam("openingDate") String openingDate,
|
||||
@RequestParam(value="externalId", required=false) String externalId) {
|
||||
|
||||
LocalDate openingLocalDate = parseStringToLocalDate(openingDate, "openingDate");
|
||||
|
||||
OfficeCommand command = new OfficeCommand(name, externalId, parentId, openingLocalDate);
|
||||
return this.commonRestOperations.createOffice(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/org/office/{officeId}", method = RequestMethod.GET)
|
||||
public @ResponseBody OfficeData viewOffice(@PathVariable("officeId") final Long officeId) {
|
||||
|
||||
return this.commonRestOperations.retrieveOffice(officeId);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/org/office/{officeId}", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier updateOffice(HttpServletRequest request, @PathVariable("officeId") final Long officeId,
|
||||
@RequestParam("name") String name,
|
||||
@RequestParam(value="parentId", required=false) Long parentId,
|
||||
@RequestParam("openingDate") String openingDate,
|
||||
@RequestParam(value="externalId", required=false) String externalId) {
|
||||
|
||||
LocalDate openingLocalDate = parseStringToLocalDate(openingDate, "openingDate");
|
||||
|
||||
OfficeCommand command = new OfficeCommand(officeId, name, externalId, parentId, openingLocalDate);
|
||||
return this.commonRestOperations.updateOffice(command);
|
||||
}
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package org.mifosng.ui.reporting;
|
||||
|
||||
import java.security.Principal;
|
||||
import java.util.Map;
|
||||
|
||||
import org.mifosng.configuration.ApplicationConfigurationService;
|
||||
import org.mifosng.configuration.OAuthProviderDetails;
|
||||
import org.mifosng.oauth.ConsumerUserDetails;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.oauth.consumer.OAuthConsumerToken;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContext;
|
||||
import org.springframework.security.oauth.consumer.OAuthSecurityContextHolder;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/reporting")
|
||||
public class ReportingController {
|
||||
|
||||
private final ReportingRestOperations reportingRestOperations;
|
||||
private final ApplicationConfigurationService applicationConfigurationService;
|
||||
|
||||
@Autowired
|
||||
public ReportingController(final ReportingRestOperations reportingRestOperations,
|
||||
ApplicationConfigurationService applicationConfigurationService) {
|
||||
this.reportingRestOperations = reportingRestOperations;
|
||||
this.applicationConfigurationService = applicationConfigurationService;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/flexireport", method = RequestMethod.GET)
|
||||
public String viewFlexibleReportingPage(final Model model, final Principal principal) {
|
||||
|
||||
UsernamePasswordAuthenticationToken authenticationToken = (UsernamePasswordAuthenticationToken) principal;
|
||||
ConsumerUserDetails user = (ConsumerUserDetails) authenticationToken.getPrincipal();
|
||||
if (user.hasNoReportingAuthority()) {
|
||||
throw new AccessDeniedException("");
|
||||
}
|
||||
|
||||
this.reportingRestOperations.hackToForceAuthentication();
|
||||
|
||||
OAuthProviderDetails oauthDetails = this.applicationConfigurationService
|
||||
.retrieveOAuthProviderDetails();
|
||||
|
||||
String resourceId = "protectedMifosNgServices";
|
||||
OAuthSecurityContext context = OAuthSecurityContextHolder.getContext();
|
||||
if (context == null) {
|
||||
throw new IllegalStateException(
|
||||
"No OAuth security context has been established. Unable to access resource '"
|
||||
+ resourceId + "'.");
|
||||
}
|
||||
|
||||
Map<String, OAuthConsumerToken> accessTokens = context
|
||||
.getAccessTokens();
|
||||
OAuthConsumerToken accessToken = accessTokens == null ? null
|
||||
: accessTokens.get(resourceId);
|
||||
|
||||
model.addAttribute("baseUrl", oauthDetails.getProviderBaseUrl());
|
||||
model.addAttribute("consumerKey", oauthDetails.getConsumerkey());
|
||||
model.addAttribute("consumerSecret", oauthDetails.getSharedSecret());
|
||||
if (accessToken != null) {
|
||||
model.addAttribute("accessToken", accessToken.getValue());
|
||||
model.addAttribute("tokenSecret", accessToken.getSecret());
|
||||
}
|
||||
|
||||
return "reports/flexireport";
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
package org.mifosng.ui.reporting;
|
||||
|
||||
public interface ReportingRestOperations {
|
||||
|
||||
void hackToForceAuthentication();
|
||||
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
package org.mifosng.ui.reporting;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import org.mifosng.configuration.ApplicationConfigurationService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.security.oauth.consumer.client.OAuthRestTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.HttpStatusCodeException;
|
||||
|
||||
@Service
|
||||
public class ReportingRestOperationsImpl implements ReportingRestOperations {
|
||||
|
||||
private final OAuthRestTemplate oauthRestServiceTemplate;
|
||||
private final ApplicationConfigurationService applicationConfigurationService;
|
||||
|
||||
@Autowired
|
||||
public ReportingRestOperationsImpl(
|
||||
final OAuthRestTemplate oauthRestServiceTemplate, final ApplicationConfigurationService applicationConfigurationService) {
|
||||
this.oauthRestServiceTemplate = oauthRestServiceTemplate;
|
||||
this.applicationConfigurationService = applicationConfigurationService;
|
||||
}
|
||||
|
||||
private HttpEntity<Object> emptyRequest() {
|
||||
HttpHeaders requestHeaders = new HttpHeaders();
|
||||
requestHeaders.set("Accept", "application/xml");
|
||||
requestHeaders.set("Content-Type", "application/xml");
|
||||
|
||||
HttpEntity<Object> requestEntity = new HttpEntity<Object>(
|
||||
requestHeaders);
|
||||
return requestEntity;
|
||||
}
|
||||
|
||||
private String getBaseServerUrl() {
|
||||
return this.applicationConfigurationService.retrieveOAuthProviderDetails().getProviderBaseUrl();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void hackToForceAuthentication() {
|
||||
try {
|
||||
URI restUri = URI
|
||||
.create(getBaseServerUrl().concat("api/protected/reporting/forceauth"));
|
||||
|
||||
this.oauthRestServiceTemplate.exchange(restUri, HttpMethod.GET, emptyRequest(), null);
|
||||
} catch (HttpStatusCodeException e) {
|
||||
System.err.println(e.getMessage());
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
+151
@@ -0,0 +1,151 @@
|
||||
package org.mifosng.ui.user;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.mifosng.data.AppUserData;
|
||||
import org.mifosng.data.EntityIdentifier;
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.mifosng.data.PermissionData;
|
||||
import org.mifosng.data.RoleData;
|
||||
import org.mifosng.data.command.RoleCommand;
|
||||
import org.mifosng.data.command.UserCommand;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.mifosng.ui.loanproduct.ClientValidationException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||
|
||||
@Controller
|
||||
public class AppUserController {
|
||||
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public AppUserController(final CommonRestOperations commonRestOperations) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/admin/permission/all", method = RequestMethod.GET)
|
||||
public @ResponseBody Collection<PermissionData> viewAllPermission() {
|
||||
|
||||
return this.commonRestOperations.retrieveAllPermissions();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/admin/role/all", method = RequestMethod.GET)
|
||||
public @ResponseBody Collection<RoleData> viewAllRoles() {
|
||||
|
||||
return this.commonRestOperations.retrieveAllRoles();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/admin/role/new", method = RequestMethod.GET)
|
||||
public @ResponseBody RoleData newRoleDetails() {
|
||||
|
||||
return this.commonRestOperations.retrieveNewRoleDetails();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/admin/role/new", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier createNewRole(@RequestParam(value="selectedItems", required=false) String[] selectedRoles,
|
||||
@RequestParam(value="name") String name,
|
||||
@RequestParam(value="description") String description) {
|
||||
|
||||
RoleCommand command = new RoleCommand(name, description, selectedRoles);
|
||||
|
||||
return this.commonRestOperations.createRole(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes = "application/json", produces = "application/json", value = "/admin/role/{roleId}", method = RequestMethod.GET)
|
||||
public @ResponseBody
|
||||
RoleData retrieveRoleDetails(@PathVariable("roleId") Long roleId) {
|
||||
|
||||
return this.commonRestOperations.retrieveRole(roleId);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/admin/role/{roleId}", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier updateRole(@PathVariable("roleId") Long roleId,
|
||||
@RequestParam(value="selectedItems", required=false) String[] selectedRoles,
|
||||
@RequestParam(value="name") String name,
|
||||
@RequestParam(value="description") String description) {
|
||||
|
||||
RoleCommand command = new RoleCommand(name, description, selectedRoles);
|
||||
command.setId(roleId);
|
||||
|
||||
return this.commonRestOperations.updateRole(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/admin/user/all", method = RequestMethod.GET)
|
||||
public @ResponseBody Collection<AppUserData> viewAllUsers() {
|
||||
|
||||
return this.commonRestOperations.retrieveAllUsers();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/admin/user/new", method = RequestMethod.GET)
|
||||
public @ResponseBody AppUserData viewUser() {
|
||||
|
||||
return this.commonRestOperations.retrieveNewUserDetails();
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/admin/user/new", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier createNewUser(@RequestParam(value="selectedItems", required=false) String[] selectedRoles,
|
||||
@RequestParam(value="username") String username,
|
||||
@RequestParam(value="firstname") String firstname,
|
||||
@RequestParam(value="lastname") String lastname,
|
||||
@RequestParam(value="email") String email,
|
||||
@RequestParam(value="officeId") Long officeId) {
|
||||
|
||||
UserCommand command = new UserCommand(username, firstname, lastname, "", email, selectedRoles, officeId);
|
||||
|
||||
return this.commonRestOperations.createUser(command);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes = "application/json", produces = "application/json", value = "/admin/user/{userId}", method = RequestMethod.DELETE)
|
||||
public @ResponseBody
|
||||
EntityIdentifier attemptToDeleteUser(@PathVariable("userId") Long userId) {
|
||||
|
||||
this.commonRestOperations.deleteUser(userId);
|
||||
|
||||
return new EntityIdentifier(Long.valueOf(1));
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/json", produces="application/json", value = "/admin/user/{userId}", method = RequestMethod.GET)
|
||||
public @ResponseBody AppUserData viewUser(@PathVariable("userId") Long userId) {
|
||||
|
||||
return this.commonRestOperations.retrieveUser(userId);
|
||||
}
|
||||
|
||||
@RequestMapping(consumes="application/x-www-form-urlencoded", produces="application/json", value = "/admin/user/{userId}", method = RequestMethod.POST)
|
||||
@ResponseStatus(HttpStatus.OK)
|
||||
public @ResponseBody EntityIdentifier updateUser(@PathVariable("userId") Long userId,
|
||||
@RequestParam(value="selectedItems", required=false) String[] selectedRoles,
|
||||
@RequestParam(value="username") String username,
|
||||
@RequestParam(value="firstname") String firstname,
|
||||
@RequestParam(value="lastname") String lastname,
|
||||
@RequestParam(value="email") String email,
|
||||
@RequestParam(value="officeId") Long officeId) {
|
||||
|
||||
UserCommand command = new UserCommand(username, firstname, lastname, "", email, selectedRoles, officeId);
|
||||
command.setId(userId);
|
||||
|
||||
return this.commonRestOperations.updateUser(command);
|
||||
}
|
||||
|
||||
@ExceptionHandler(ClientValidationException.class)
|
||||
public @ResponseBody Collection<ErrorResponse> validationException(ClientValidationException ex, HttpServletResponse response) {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.setContentType("application/json");
|
||||
|
||||
return ex.getValidationErrors();
|
||||
}
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
package org.mifosng.ui.user;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.servlet.ServletOutputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.mifosng.data.ErrorResponse;
|
||||
import org.mifosng.data.reports.GenericResultset;
|
||||
import org.mifosng.data.reports.ResultsetColumnHeader;
|
||||
import org.mifosng.data.reports.ResultsetDataRow;
|
||||
import org.mifosng.ui.CommonRestOperations;
|
||||
import org.mifosng.ui.loanproduct.ClientValidationException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@Controller
|
||||
public class ExportCSVController {
|
||||
|
||||
private final static Logger logger = LoggerFactory.getLogger(ExportCSVController.class);
|
||||
|
||||
private final CommonRestOperations commonRestOperations;
|
||||
|
||||
@Autowired
|
||||
public ExportCSVController(final CommonRestOperations commonRestOperations) {
|
||||
this.commonRestOperations = commonRestOperations;
|
||||
}
|
||||
|
||||
@ExceptionHandler(AccessDeniedException.class)
|
||||
public String accessDeniedException() {
|
||||
return "unAuthorizedAction";
|
||||
}
|
||||
|
||||
@ExceptionHandler(ClientValidationException.class)
|
||||
public @ResponseBody Collection<ErrorResponse> validationException(ClientValidationException ex, HttpServletResponse response) {
|
||||
|
||||
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
|
||||
response.setContentType("application/json");
|
||||
|
||||
return ex.getValidationErrors();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/exportcsv*", method = RequestMethod.GET)
|
||||
public void handleExportCSV(final HttpServletRequest request, HttpServletResponse response) throws IOException {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, String[]> queryParams = request.getParameterMap();
|
||||
|
||||
String rptDB = queryParams.get("MRP_rptDB")[0];
|
||||
String name = queryParams.get("MRP_Name")[0];
|
||||
String type = queryParams.get("MRP_Type")[0];
|
||||
|
||||
Set<String> keys = queryParams.keySet();
|
||||
Map<String, String> extractedQueryParams = new HashMap<String, String>();
|
||||
String pKey;
|
||||
String pValue;
|
||||
for (String k : keys) {
|
||||
|
||||
if (k.startsWith("MRP_")) {
|
||||
pKey = "${" + k.substring(4) + "}";
|
||||
pValue = queryParams.get(k)[0];
|
||||
// logger.info(name + ": " + pKey + ": " + pValue);
|
||||
extractedQueryParams.put(pKey, pValue);
|
||||
}
|
||||
}
|
||||
|
||||
// if (extractedQueryParams.size() > 3) {
|
||||
// throw new UnsupportedOperationException("Not able to support this report for export to CSV right now.");
|
||||
// }
|
||||
|
||||
GenericResultset result = this.commonRestOperations.retrieveReportingData(rptDB, name, type, extractedQueryParams);
|
||||
|
||||
// response.setContentType("application/octet-stream");
|
||||
response.setContentType("application/x-msdownload");
|
||||
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment;filename=" + name.replaceAll(" ", "") + ".csv");
|
||||
|
||||
ServletOutputStream out = response.getOutputStream();
|
||||
StringBuffer sb = generateCsvFileBuffer(result);
|
||||
|
||||
InputStream in = new ByteArrayInputStream(sb.toString().getBytes(
|
||||
"UTF-8"));
|
||||
|
||||
byte[] outputByte = new byte[4096];
|
||||
Integer readLen = in.read(outputByte, 0, 4096);
|
||||
|
||||
while (readLen != -1) {
|
||||
out.write(outputByte, 0, readLen);
|
||||
readLen = in.read(outputByte, 0, 4096);
|
||||
}
|
||||
in.close();
|
||||
out.flush();
|
||||
out.close();
|
||||
|
||||
}
|
||||
|
||||
private static StringBuffer generateCsvFileBuffer(GenericResultset result) {
|
||||
StringBuffer writer = new StringBuffer();
|
||||
|
||||
List<ResultsetColumnHeader> columnHeaders = result.getColumnHeaders();
|
||||
logger.info("NO. of Columns: " + columnHeaders.size());
|
||||
Integer chSize = columnHeaders.size();
|
||||
for (int i = 0; i < chSize; i++) {
|
||||
writer.append('"' + columnHeaders.get(i).getColumnName() + '"');
|
||||
if (i < (chSize - 1))
|
||||
writer.append(",");
|
||||
}
|
||||
writer.append('\n');
|
||||
|
||||
List<ResultsetDataRow> data = result.getData();
|
||||
List<String> row;
|
||||
Integer rSize;
|
||||
// String currCol;
|
||||
String currColType;
|
||||
String currVal;
|
||||
logger.info("NO. of Rows: " + data.size());
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
row = data.get(i).getRow();
|
||||
rSize = row.size();
|
||||
for (int j = 0; j < rSize; j++) {
|
||||
// currCol = columnHeaders.get(j).getColumnName();
|
||||
currColType = columnHeaders.get(j).getColumnType();
|
||||
currVal = row.get(j);
|
||||
if (currVal != null) {
|
||||
if (currColType.equals("DECIMAL")
|
||||
|| currColType.equals("DOUBLE")
|
||||
|| currColType.equals("BIGINT")
|
||||
|| currColType.equals("SMALLINT")
|
||||
|| currColType.equals("INT"))
|
||||
writer.append(currVal);
|
||||
else
|
||||
writer.append('"' + currVal + '"');
|
||||
}
|
||||
if (j < (rSize - 1))
|
||||
writer.append(",");
|
||||
}
|
||||
writer.append('\n');
|
||||
}
|
||||
|
||||
return writer;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
|
||||
http://www.springframework.org/schema/webflow-config
|
||||
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd
|
||||
http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
|
||||
<context:component-scan base-package="org.mifosng.ui, org.mifosng.configuration, org.mifosng.oauth">
|
||||
<context:exclude-filter expression="org.springframework.stereotype.Controller" type="annotation" />
|
||||
</context:component-scan>
|
||||
|
||||
<import resource="securityContext.xml" />
|
||||
</beans>
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:security="http://www.springframework.org/schema/security"
|
||||
xmlns:oauth="http://www.springframework.org/schema/security/oauth"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd
|
||||
http://www.springframework.org/schema/security/oauth http://www.springframework.org/schema/security/spring-security-oauth-1.0.xsd">
|
||||
|
||||
<bean id="loginForm" class="org.springframework.security.web.authentication.LoginUrlAuthenticationEntryPoint">
|
||||
<!-- force redirect to client applications home page if auth required -->
|
||||
<property name="loginFormUrl" value="/forceOAuth" />
|
||||
</bean>
|
||||
|
||||
<bean id="securityContextPersistenceFilter" class="org.springframework.security.web.context.SecurityContextPersistenceFilter">
|
||||
<property name="securityContextRepository" ref="securityContextRepository" />
|
||||
</bean>
|
||||
|
||||
<bean id="securityContextRepository" class="org.springframework.security.web.context.HttpSessionSecurityContextRepository" />
|
||||
|
||||
<bean id="delegateLogoutHandler" class="org.springframework.security.web.authentication.logout.SecurityContextLogoutHandler" />
|
||||
|
||||
<bean id="logoutFilter" class="org.springframework.security.web.authentication.logout.LogoutFilter">
|
||||
<constructor-arg value="/logout" />
|
||||
<constructor-arg>
|
||||
<list>
|
||||
<bean class="org.mifosng.oauth.OAuthLogoutHandler">
|
||||
<constructor-arg ref="delegateLogoutHandler" />
|
||||
<constructor-arg ref="mifosNgInMemoryResourceDetailsService"/>
|
||||
<constructor-arg ref="rememberMeServices"/>
|
||||
</bean>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="requestCacheFilter" class="org.springframework.security.web.savedrequest.RequestCacheAwareFilter" />
|
||||
|
||||
<bean id="servletApiFilter" class="org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter" />
|
||||
|
||||
<bean id="anonymousAuthenticationFilter" class="org.springframework.security.web.authentication.AnonymousAuthenticationFilter" >
|
||||
<property name="key" value="SomeUniqueKeyForThisApplication" />
|
||||
<property name="userAttribute" value="anonymousUser,ROLE_ANONYMOUS" />
|
||||
</bean>
|
||||
|
||||
<bean id="sessionManagementFilter" class="org.springframework.security.web.session.SessionManagementFilter" >
|
||||
<constructor-arg ref="securityContextRepository" />
|
||||
</bean>
|
||||
|
||||
<bean id="exceptionTranslationFilter" class="org.springframework.security.web.access.ExceptionTranslationFilter">
|
||||
<property name="authenticationEntryPoint" ref="loginForm" />
|
||||
</bean>
|
||||
|
||||
<security:authentication-manager alias="authenticationManager">
|
||||
<security:authentication-provider>
|
||||
<security:user-service>
|
||||
<security:user name="marissa" password="wombat" authorities="ROLE_USER" />
|
||||
<security:user name="sam" password="kangaroo" authorities="ROLE_USER" />
|
||||
</security:user-service>
|
||||
</security:authentication-provider>
|
||||
</security:authentication-manager>
|
||||
|
||||
<bean id="accessDecisionManager" class="org.springframework.security.access.vote.AffirmativeBased">
|
||||
<property name="decisionVoters">
|
||||
<list>
|
||||
<bean class="org.springframework.security.access.vote.RoleVoter"/>
|
||||
<bean class="org.springframework.security.access.vote.AuthenticatedVoter"/>
|
||||
<bean class="org.springframework.security.web.access.expression.WebExpressionVoter"/>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="filterSecurityInterceptor" class="org.springframework.security.web.access.intercept.FilterSecurityInterceptor">
|
||||
<property name="securityMetadataSource">
|
||||
<security:filter-security-metadata-source use-expressions="true" id="expressionBasedSecurityMetadata">
|
||||
<security:intercept-url pattern="/forceOAuth" access="isAnonymous()" />
|
||||
<security:intercept-url pattern="/logout" access="isAnonymous()" />
|
||||
<security:intercept-url pattern="/oauth/**" access="isAnonymous()" />
|
||||
<security:intercept-url pattern="/home" access="isFullyAuthenticated()" />
|
||||
<security:intercept-url pattern="/exportcsv*" access="isFullyAuthenticated()" />
|
||||
<security:intercept-url pattern="/**" access="isFullyAuthenticated()" />
|
||||
</security:filter-security-metadata-source>
|
||||
</property>
|
||||
<property name="authenticationManager" ref="authenticationManager" />
|
||||
<property name="accessDecisionManager" ref="accessDecisionManager" />
|
||||
</bean>
|
||||
|
||||
<bean id="rememberMeServices" class="org.springframework.security.oauth.consumer.rememberme.HttpSessionOAuthRememberMeServices" />
|
||||
|
||||
<bean id="oauthFailureHandler" class="org.springframework.security.web.access.AccessDeniedHandlerImpl">
|
||||
<property name="errorPage" value="/oauth_error" />
|
||||
</bean>
|
||||
|
||||
<!--
|
||||
<bean id="mifosNgInMemoryResourceDetailsService" class="org.mifosng.oauth.MifosNgProtectedResourceDetailsService" />
|
||||
-->
|
||||
|
||||
<bean id="resourceDetailsService" class="org.springframework.security.oauth.consumer.client.CoreOAuthConsumerSupport">
|
||||
<property name="protectedResourceDetailsService" ref="mifosNgInMemoryResourceDetailsService" />
|
||||
</bean>
|
||||
|
||||
<!-- org.springframework.security.oauth.consumer.filter.OAuthConsumerContextFilter -->
|
||||
<bean id="oauthConsumerContextFilter" class="org.mifosng.oauth.CustomOAuthConsumerContextFilter">
|
||||
<property name="rememberMeServices" ref="rememberMeServices" />
|
||||
<property name="OAuthFailureHandler" ref="oauthFailureHandler" />
|
||||
<property name="consumerSupport" ref="resourceDetailsService" />
|
||||
</bean>
|
||||
|
||||
<bean id="oauthSecurityMetaData" class="org.mifosng.oauth.OAuthConsumerFilterFilterInvocationSecurityMetadataSource" />
|
||||
|
||||
<!-- org.springframework.security.oauth.consumer.filter.OAuthConsumerProcessingFilter -->
|
||||
<bean id="oauthConsumerProcessingFilter" class="org.springframework.security.oauth.consumer.filter.OAuthConsumerProcessingFilter">
|
||||
<property name="protectedResourceDetailsService" ref="mifosNgInMemoryResourceDetailsService" />
|
||||
<property name="objectDefinitionSource" ref="oauthSecurityMetaData" />
|
||||
</bean>
|
||||
|
||||
<bean id="filterChainProxy" class="org.springframework.security.web.FilterChainProxy">
|
||||
<constructor-arg>
|
||||
<list>
|
||||
<security:filter-chain pattern="/resources/**" filters="none" />
|
||||
<security:filter-chain pattern="/**" filters="securityContextPersistenceFilter, logoutFilter, requestCacheFilter, servletApiFilter,
|
||||
anonymousAuthenticationFilter, sessionManagementFilter, exceptionTranslationFilter, filterSecurityInterceptor,
|
||||
oauthConsumerContextFilter, oauthConsumerProcessingFilter" />
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</Pattern>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
|
||||
<file>${catalina.home}/logs/mifosng-consumer.log</file>
|
||||
<append>true</append>
|
||||
<!-- encoders are assigned the type
|
||||
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
|
||||
<encoder>
|
||||
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
|
||||
|
||||
<logger name="org.mifosng" level="debug" />
|
||||
|
||||
<root level="info">
|
||||
<appender-ref ref="STDOUT" />
|
||||
<appender-ref ref="FILE" />
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -0,0 +1,6 @@
|
||||
tabletools=/stretchyreporting/DataTables-1.8.2/extras/TableTools/media/css/TableTools.css
|
||||
datatable.demopage=/stretchyreporting/DataTables-1.8.2/media/css/demo_page.css
|
||||
datatable.demotable=/stretchyreporting/DataTables-1.8.2/media/css/demo_table.css
|
||||
jqueryui=/stretchyreporting/jquery-ui-1.8.16.custom/css/smoothness/jquery-ui-1.8.16.custom.css
|
||||
excelcss=/excel/excel-2007.css
|
||||
allinone=/allinone.css
|
||||
@@ -0,0 +1,6 @@
|
||||
tabletools=/stretchyreporting/DataTables-1.8.2/extras/TableTools/media/css/TableTools.css
|
||||
datatable.demopage=/stretchyreporting/DataTables-1.8.2/media/css/demo_page.css
|
||||
datatable.demotable=/stretchyreporting/DataTables-1.8.2/media/css/demo_table.css
|
||||
jqueryui=/stretchyreporting/jquery-ui-1.8.16.custom/css/redmond/jquery-ui-1.8.16.custom.css
|
||||
excelcss=/excel/excel-2007.css
|
||||
allinone=/allinone.css
|
||||
@@ -0,0 +1,6 @@
|
||||
tabletools=/stretchyreporting/DataTables-1.8.2/extras/TableTools/media/css/TableTools.css
|
||||
datatable.demopage=/stretchyreporting/DataTables-1.8.2/media/css/demo_page.css
|
||||
datatable.demotable=/stretchyreporting/DataTables-1.8.2/media/css/demo_table.css
|
||||
jqueryui=/stretchyreporting/jquery-ui-1.8.16.custom/css/ui-lightness/jquery-ui-1.8.16.custom.css
|
||||
excelcss=/excel/excel-2007.css
|
||||
allinone=/allinone.css
|
||||
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
|
||||
http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
|
||||
|
||||
<!-- The controllers are autodetected POJOs labeled with the @Controller annotation. -->
|
||||
<context:component-scan base-package="org.mifosng.ui" use-default-filters="false">
|
||||
<context:include-filter expression="org.springframework.stereotype.Controller" type="annotation"/>
|
||||
</context:component-scan>
|
||||
|
||||
<bean id="mvcConversionService" class="org.springframework.format.support.FormattingConversionServiceFactoryBean" />
|
||||
|
||||
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
|
||||
<property name="basename" value="/WEB-INF/static/global-translations/messages" />
|
||||
<property name="defaultEncoding" value="UTF-8" />
|
||||
<property name="fallbackToSystemLocale" value="false" />
|
||||
</bean>
|
||||
|
||||
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
|
||||
<property name="defaultLocale" value="en" />
|
||||
</bean>
|
||||
|
||||
<bean id="themeSource" class="org.springframework.ui.context.support.ResourceBundleThemeSource">
|
||||
<property name="basenamePrefix" value="theme-" />
|
||||
</bean>
|
||||
|
||||
<bean id="themeResolver" class="org.springframework.web.servlet.theme.SessionThemeResolver">
|
||||
<property name="defaultThemeName" value="default" />
|
||||
</bean>
|
||||
|
||||
<!-- Turns on support for mapping requests to Spring MVC @Controller methods (DefaultAnnotationHandler is added to list of handlers)
|
||||
Also registers default Formatters and Validators for use across all @Controllers -->
|
||||
<mvc:annotation-driven conversion-service="mvcConversionService" />
|
||||
<mvc:interceptors>
|
||||
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
|
||||
<property name="paramName" value="lang" />
|
||||
</bean>
|
||||
<bean class="org.springframework.web.servlet.theme.ThemeChangeInterceptor">
|
||||
<property name="paramName" value="theme" />
|
||||
</bean>
|
||||
</mvc:interceptors>
|
||||
|
||||
<mvc:default-servlet-handler />
|
||||
|
||||
<mvc:resources location="/WEB-INF/static/" mapping="/resources/**" cache-period="31556926"/>
|
||||
|
||||
<mvc:view-controller path="/logout" view-name="logout"/>
|
||||
<mvc:view-controller path="/oauth_error" view-name="oauth_error"/>
|
||||
|
||||
<!-- Resolves view names to protected .jsp resources within the /WEB-INF/views directory -->
|
||||
<bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="prefix" value="/WEB-INF/views/"/>
|
||||
<property name="suffix" value=".jsp"/>
|
||||
</bean>
|
||||
</beans>
|
||||
@@ -0,0 +1,74 @@
|
||||
/*reset*/
|
||||
html{color:#000;background:#FFF;}body{margin:0 auto;font-family:Arial, Helvetica, Sans-Serif; font-size:12px;},div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:text-top;}sub{vertical-align:text-bottom;}input,textarea,select{font-family:inherit;font-size:inherit;font-weight:inherit;}input,textarea,select{*font-size:100%;}legend{color:#000;}
|
||||
strong{font-weight: bolder;}
|
||||
/*General*/
|
||||
div#container {margin-top:0px;}
|
||||
div#content {margin-left:5px; margin-right:5px;}
|
||||
/*top navigation*/
|
||||
#nav, #nav ul {padding:0;margin:0;list-style:none;}
|
||||
#nav a {display:block;padding:7px 7px 7px 7px;color:#ccc;text-decoration:none;}
|
||||
#nav a.dmenu {}
|
||||
#nav a.dmenu:hover {color:#3366CC !important;background-color: #fff !important;}
|
||||
#navwrapper {background-color: #2D2D2D;height:30px;}
|
||||
#nav {padding-top:0px;}
|
||||
#nav li {float: left; }
|
||||
#nav li {position: relative;}
|
||||
#nav li {position: static; width: auto;}/* hide from IE, mac */
|
||||
#nav li ul {position: absolute;display: none;margin-left:-1px;padding-bottom:10px;background-color: #FFFFFF;border: 1px solid #bbb;border-top:none;-moz-box-shadow: 0 0 5px #ddd;-webkit-box-shadow: 0 0 5px #ddd;box-shadow: 0 0 5px #ddd;z-index:5000;}
|
||||
#nav li:hover a, #nav a:focus,
|
||||
#nav a:active {padding:7px 7px 7px 7px;color:#fff;background:#444;text-decoration:none;}
|
||||
#nav li ul, #nav ul li {width: 10em;}
|
||||
#nav ul li a {color: #3366CC !important;border-right: 0;}
|
||||
#nav ul li a:hover {color:#3366CC !important;background-color: #eef3fb !important;border-right: 0;}
|
||||
#nav a.current {color:#fff;font-weight:bold;background:#2D2D2D;text-decoration:none;border-top:2px solid #C33;padding-bottom:5px;}
|
||||
#nav a.current:hover{padding-bottom:5px;}
|
||||
#nav li:hover ul {display: block;}
|
||||
#nav li:hover ul a{color: #000000;background-color: transparent;}
|
||||
#nav ul a:hover {background-color: #606060!important;color: #FFFFFF !important;}
|
||||
.menuseprator{border-bottom:1px solid #ddd; margin:10px 0 10px 0;}
|
||||
.arrowdown{color#eee; font-size:0.5em;}
|
||||
.floatleft{float:left;}
|
||||
.floatright{float:right;}
|
||||
.clear{clear:both;}
|
||||
/*end of top navigation css*/
|
||||
/*simple vertical form*/
|
||||
label {display: block; font-size: 14px; padding-top: 3px;}
|
||||
#formcontainer input {font-size:12px; padding:4px 2px; border:solid 1px #aacfe4; width: 402px;}
|
||||
#formcontainer select {font-size:12px; padding:3px 2px; border:solid 1px #aacfe4; width: 402px;}
|
||||
fieldset {border-top: 1px solid;}
|
||||
legend {margin-left: 10px; font-size: 14px; font-weight: bold;}
|
||||
#ignorefornow button {clear:both; margin-left:225px; width:125px; height:31px;
|
||||
background:#666666 no-repeat; text-align:center;
|
||||
line-height:31px; color:#FFFFFF; font-size:11px; font-weight:bold;}
|
||||
#formcontainer {margin:0 auto; width: auto; border:solid 2px #b7ddf2; background:#ebf4fb; padding: 14px;}
|
||||
a.multiselectwidget {display: block; border: 1px solid #aaa; text-decoration: none;
|
||||
background-color: #fafafa; color: #123456; clear:both;}
|
||||
div.multiselectwidget {float:left; text-align: center; margin-right: 10px;}
|
||||
select.multiselectwidget {width: 450px; height: 80px;}
|
||||
|
||||
/*display of information in label, attribute fashion*/
|
||||
.row .shortrowlabel {float: left; width: 6em; text-align: left; margin-right: 0.5em;}
|
||||
.row .rowlabel {float: left; width: 8em; text-align: left; margin-right: 0.5em;}
|
||||
.row .longrowlabel {float: left; width: 18em; text-align: left; margin-right: 0.5em;}
|
||||
.row .rowvalue {text-align: left; display: inline-block;}
|
||||
/**/
|
||||
#toolbar {padding: 9px 5px;}
|
||||
/*datatables*/
|
||||
table.pretty {width:100%;}
|
||||
table.pretty th, table.pretty td {border: 1px gainsboro solid;padding: 0.2em;}
|
||||
table.pretty caption {margin-left: inherit;margin-right: inherit;font-style: italic;font-weight: bold;}
|
||||
table.pretty thead tr th {text-align: center;font-weight: bold;border-bottom: 2px solid;}
|
||||
table.pretty thead tr th.empty {border: 0px;}
|
||||
table.pretty tfoot tr th {text-align: center;font-weight: bold;border-bottom: 2px solid;border-top: 2px solid;}
|
||||
table.pretty tbody tr th {text-align: center;}
|
||||
table.pretty tbody tr td {text-align: center; border-top: solid 1px;}
|
||||
table.pretty tbody tr.odd td {background: #EBF4FB;}
|
||||
table.pretty tbody tr.even td {background: #BCEEEE;}
|
||||
table.pretty thead tr th.highlightcol {border-top: solid 2px #2E6E9E;border-left: solid 2px #2E6E9E;border-right: solid 2px #2E6E9E; border-bottom: 1px gainsboro solid;}
|
||||
table.pretty tfoot tr th.highlightcol {border-left: solid 2px #2E6E9E;border-right: solid 2px #2E6E9E;}
|
||||
table.pretty thead tr th.lefthighlightcol, table.pretty tbody tr td.lefthighlightcol, table.pretty tfoot tr th.lefthighlightcol{border-left: solid 2px #2E6E9E;}
|
||||
table.pretty thead tr th.righthighlightcol, table.pretty tbody tr td.righthighlightcol, table.pretty tfoot tr th.righthighlightcol {border-right: solid 2px #2E6E9E;}
|
||||
table.pretty thead tr th.lefthighlightcolheader, table.pretty tbody tr td.lefthighlightcolheader, table.pretty tfoot tr th.lefthighlightcolheader {border-left: solid 2px #2E6E9E;}
|
||||
table.pretty thead tr th.righthighlightcolheader, table.pretty tbody tr td.righthighlightcolheader, table.pretty tfoot tr th.righthighlightcolheader {border-right: solid 2px #2E6E9E;}
|
||||
|
||||
div.loantabs {margin-top: 5px;}
|
||||
@@ -0,0 +1,180 @@
|
||||
(function($) {
|
||||
|
||||
$.appui = {};
|
||||
|
||||
$.views.registerHelpers({
|
||||
decimal: function(number, digits) {
|
||||
try {
|
||||
return number.toFixed(digits);
|
||||
} catch(e) {
|
||||
return number +"(NaN)";
|
||||
}
|
||||
},
|
||||
number: function(number) {
|
||||
try {
|
||||
return number.toFixed(0);
|
||||
} catch(e) {
|
||||
return number +"(NaN)";
|
||||
}
|
||||
},
|
||||
json: function(obj) {
|
||||
try {
|
||||
return JSON.stringify(obj);
|
||||
} catch(e) {
|
||||
return "" + e;
|
||||
}
|
||||
},
|
||||
localDate: function(dateParts) {
|
||||
try {
|
||||
|
||||
var year = dateParts[0];
|
||||
var month = parseInt(dateParts[1]) - 1; // month is zero indexed
|
||||
var day = dateParts[2];
|
||||
|
||||
var d = new Date();
|
||||
d.setFullYear(year,month,day);
|
||||
|
||||
return d.toDateString();
|
||||
} catch(e) {
|
||||
return "??";
|
||||
}
|
||||
},
|
||||
toISODate: function(dateParts) {
|
||||
try {
|
||||
|
||||
var year = dateParts[0];
|
||||
var month = parseInt(dateParts[1]);
|
||||
var day = parseInt(dateParts[2]);
|
||||
|
||||
var monthStr = '' + month;
|
||||
if (month < 10) {
|
||||
monthStr = '0' + month;
|
||||
}
|
||||
var dayStr = '' + day;
|
||||
if (day < 10) {
|
||||
dayStr = '0' + day;
|
||||
}
|
||||
|
||||
return year + '-' + monthStr + '-' + dayStr;
|
||||
} catch(e) {
|
||||
return "??";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function handleXhrError(jqXHR, textStatus, errorThrown, templateSelector, placeholderDiv) {
|
||||
if (jqXHR.status === 0) {
|
||||
alert('Not connect.\n Verify Network.');
|
||||
} else if (jqXHR.status == 404) {
|
||||
alert('Requested page not found. [404]');
|
||||
} else if (jqXHR.status == 500) {
|
||||
alert('Internal Server Error [500].');
|
||||
} else if (errorThrown === 'parsererror') {
|
||||
alert('Requested JSON parse failed.');
|
||||
} else if (errorThrown === 'timeout') {
|
||||
alert('Time out error.');
|
||||
} else if (errorThrown === 'abort') {
|
||||
alert('Ajax request aborted.');
|
||||
} else {
|
||||
// remove error class from all input fields
|
||||
var $inputs = $('#entityform :input');
|
||||
|
||||
$inputs.each(function() {
|
||||
$(this).removeClass("ui-state-error");
|
||||
});
|
||||
|
||||
$(placeholderDiv).html("");
|
||||
|
||||
var jsonErrors = JSON.parse(jqXHR.responseText);
|
||||
|
||||
var errorArray = new Array();
|
||||
var arrayIndex = 0;
|
||||
$.each(jsonErrors, function() {
|
||||
var fieldId = '#' + this.field;
|
||||
$(fieldId).addClass("ui-state-error");
|
||||
|
||||
var errorObj = new Object();
|
||||
errorObj.field = this.field;
|
||||
errorObj.code = this.code;
|
||||
errorObj.message = this.code;
|
||||
errorObj.value = this.value;
|
||||
|
||||
errorArray[arrayIndex] = errorObj;
|
||||
arrayIndex++
|
||||
});
|
||||
|
||||
var templateArray = new Array();
|
||||
var templateErrorObj = new Object();
|
||||
templateErrorObj.title = "You have the following errors:";
|
||||
templateErrorObj.errors = errorArray;
|
||||
|
||||
templateArray[0] = templateErrorObj;
|
||||
|
||||
var formErrorsHtml = $(templateSelector).render(templateArray);
|
||||
|
||||
$(placeholderDiv).append(formErrorsHtml);
|
||||
}
|
||||
}
|
||||
|
||||
function popupDialogWithFormView(url, title, templateSelector, width, height, successFunction) {
|
||||
var dialogDiv = $("<div id='dialog-form'></div>");
|
||||
var jqxhr = $.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
contentType: 'application/json',
|
||||
dataType: 'json',
|
||||
success: function(data, textStatus, jqXHR) {
|
||||
|
||||
var formHtml = $(templateSelector).render(data);
|
||||
|
||||
dialogDiv.append(formHtml);
|
||||
|
||||
dialogDiv.dialog({
|
||||
title: title,
|
||||
width: width,
|
||||
height: height,
|
||||
modal: true,
|
||||
buttons: {
|
||||
"Save": function() {
|
||||
$('.multiSelectedItems option').each(function(i) {
|
||||
$(this).attr("selected", "selected");
|
||||
});
|
||||
|
||||
var form_data = $('#entityform').serialize();
|
||||
|
||||
var jqxhr = $.ajax({
|
||||
url: url,
|
||||
type: 'POST',
|
||||
data: form_data,
|
||||
success: successFunction,
|
||||
error: function(jqXHR, textStatus, errorThrown) {
|
||||
handleXhrError(jqXHR, textStatus, errorThrown, "#formErrorsTemplate", "#formerrors");
|
||||
}
|
||||
});
|
||||
},
|
||||
"Cancel": function() {
|
||||
$(this).dialog( "close" );
|
||||
}
|
||||
// end of buttons
|
||||
},
|
||||
close: function() {
|
||||
// if i dont do this, theres a problem with errors being appended to dialog view second time round
|
||||
$(this).remove();
|
||||
},
|
||||
open: function (event, ui) {
|
||||
$('.multiadd').click(function() {
|
||||
return !$('.multiNotSelectedItems option:selected').remove().appendTo('#selectedItems');
|
||||
});
|
||||
|
||||
$('.multiremove').click(function() {
|
||||
return !$('.multiSelectedItems option:selected').remove().appendTo('#notSelectedItems');
|
||||
});
|
||||
|
||||
$('.datepickerfield').datepicker({constrainInput: true, maxDate: '0', dateFormat: 'yy-mm-dd'});
|
||||
}
|
||||
}).dialog('open');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
})(jQuery);
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 819 B |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 927 B |
@@ -0,0 +1,45 @@
|
||||
.ExcelTable2007 {
|
||||
border: 1px solid #B0CBEF;
|
||||
border-width: 1px 0px 0px 1px;
|
||||
font-size: 11pt;
|
||||
font-family: Calibri;
|
||||
font-weight: 100;
|
||||
border-spacing: 0px;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.ExcelTable2007 TH {
|
||||
background-image: url(excel-2007-header-bg.gif);
|
||||
background-repeat: repeat-x;
|
||||
font-weight: normal;
|
||||
font-size: 14px;
|
||||
border: 1px solid #9EB6CE;
|
||||
border-width: 0px 1px 1px 0px;
|
||||
height: 17px;
|
||||
}
|
||||
|
||||
.ExcelTable2007 TD {
|
||||
border: 0px;
|
||||
background-color: white;
|
||||
padding: 0px 4px 0px 2px;
|
||||
border: 1px solid #D0D7E5;
|
||||
border-width: 0px 1px 1px 0px;
|
||||
}
|
||||
|
||||
.ExcelTable2007 TD B {
|
||||
border: 0px;
|
||||
background-color: white;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.ExcelTable2007 TD.heading {
|
||||
background-color: #E4ECF7;
|
||||
text-align: center;
|
||||
border: 1px solid #9EB6CE;
|
||||
border-width: 0px 1px 1px 0px;
|
||||
}
|
||||
|
||||
.ExcelTable2007 TH.heading {
|
||||
background-image: url(excel-2007-header-left.gif);
|
||||
background-repeat: none;
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 318 B |
+354
@@ -0,0 +1,354 @@
|
||||
# jQuery.1ln8 plugin seems to give first line of properties file as error for some reason.
|
||||
app.name=Mifos - Individual Lending:
|
||||
|
||||
link.topnav.clients=Clients
|
||||
link.topnav.users=User Administration
|
||||
link.topnav.organisation=Organisation Administration
|
||||
link.reports=Reports
|
||||
link.signout=Sign out
|
||||
link.topnav.account.settings=Account Settings
|
||||
link.topnav.theme=Theme
|
||||
link.topnav.culture=Culture
|
||||
|
||||
page.home.title=Home
|
||||
tab.search=Search
|
||||
label.client.search=Choose client:
|
||||
option.client.search.first.choice=--Select Client--
|
||||
link.add.new.client=Add a new client
|
||||
|
||||
page.client.account.title=View Client Account Details
|
||||
page.admin.home.title=Administration Home
|
||||
page.admin.settings.title=Account Settings
|
||||
|
||||
dialog.title.add.client=Add client
|
||||
label.office=Office:
|
||||
option.office.first.choice=--Select Office--
|
||||
label.lastname=Last name:
|
||||
label.firstname=First name:
|
||||
label.longname=Full name:
|
||||
label.joiningdate=Joining date:
|
||||
|
||||
error.msg.header=You have the following errors:
|
||||
validation.msg.client.office.cannot.be.blank=A client must be associated with an office.
|
||||
validation.msg.client.firstname.cannot.be.blank=First name cannot be blank.
|
||||
validation.msg.client.lastname.cannot.be.blank=Last name cannot be blank.
|
||||
validation.msg.client.joining.date.cannot.be.blank=Joining date cannot be blank.
|
||||
validation.msg.client.fullname.must.be.provide.or.firstname.lastname=A fullname must be provided or else both firstname and lastname details.
|
||||
validation.msg.client.fullname.cannot.entered.when.firstname.or.lastname.entered=You cannot provide both fullname and firstname or lastname details. A fullname must be provided or else both firstname and lastname details.
|
||||
|
||||
error.msg.client.id.invalid=Client does not exist.
|
||||
error.msg.office.id.invalid=Office does not exist.
|
||||
error.msg.office.duplicate.externalId=An office with 'External Id' already exists.
|
||||
error.msg.office.duplicate.name=An office with 'name' already exists.
|
||||
error.msg.office.unknown.data.integretity.issue=An unknown data integrity issue occured.
|
||||
|
||||
dialog.title.confirmation.required=Confirmation required
|
||||
text.confirmation.required=Are you sure?
|
||||
dialog.title.functionality.not.available=Functionality not yet available
|
||||
dialog.messages.functionality.not.available=Functionality not yet available.
|
||||
|
||||
dialog.button.submit=Submit
|
||||
dialog.button.save=Save
|
||||
dialog.button.cancel=Cancel
|
||||
dialog.button.ok=Ok
|
||||
dialog.button.confirm=Confirm
|
||||
link.edit=Edit
|
||||
widget.multiselect.button.add=Add
|
||||
widget.multiselect.button.remove=Remove
|
||||
|
||||
dialog.title.new.loan.application=New loan application
|
||||
dialog.button.new.loan.application=New loan application
|
||||
dialog.button.reject.loan=Reject
|
||||
dialog.button.withdrawn.by.client.loan=Withdrawn by applicant
|
||||
dialog.button.approve.loan=Approve
|
||||
dialog.button.delete.loan=Delete
|
||||
dialog.button.undo.loan.approval=Undo approval
|
||||
dialog.button.undo.loan.disbursal=Undo disbursal
|
||||
dialog.button.disburse.loan=Disburse
|
||||
dialog.button.loan.repayment=Loan repayment
|
||||
dialog.button.adjust.loan.repayment=Adjust
|
||||
dialog.button.loan.waive=Waive
|
||||
|
||||
dialog.button.add.note=Add note
|
||||
label.client.account.name=Name:
|
||||
label.client.account.branch=Branch:
|
||||
label.client.account.joinedon=Joined on:
|
||||
heading.client.account.account.overview=Account Overview
|
||||
label.client.account.pending.approval.loans=Pending approval loans
|
||||
label.client.account.pending.disbursal.loans=Awaiting disbursal loans
|
||||
label.client.account.active.loans=Active loans
|
||||
label.client.account.closed.loans=Closed loans
|
||||
label.client.account.no.loans.exist=No accounts exist
|
||||
heading.client.account.extra.information=Additional Information
|
||||
dialog.title.edit.additional.client.information=Edit additional client information
|
||||
|
||||
widget.notes.heading=You have the following notes:
|
||||
widget.notes.label.client.note=Client note:
|
||||
widget.notes.label.loan.note=Loan note:
|
||||
widget.notes.label.loan.transaction.note=Loan transaction note:
|
||||
|
||||
dialog.title.add.note=Add note
|
||||
dialog.title.edit.note=Edit note
|
||||
dialog.notes.form.label.note=Note:
|
||||
|
||||
# error handling messages for loan event and transactions screens
|
||||
error.msg.no.loan.with.identifier.exists=No loan with identifier {0} exists.
|
||||
error.msg.no.permission=You do not have sufficient permissions to perform this action.
|
||||
error.msg.no.permission.to.approve.loan.in.past=You do not have permission to approve a loan with a date in the past.
|
||||
error.msg.no.permission.to.reject.loan.in.past=You do not have permission to reject a loan with a date in the past.
|
||||
error.msg.no.permission.to.withdraw.loan.in.past=You do not have permission to withdraw a loan with a date in the past.
|
||||
error.msg.no.permission.to.disburse.loan.in.past=You do not have permission to disburse a loan with a date in the past.
|
||||
error.msg.no.permission.to.make.repayment.on.loan.in.past=You do not have permission to make a repayment on the loan with a date in the past.
|
||||
error.msg.cannot.delete.loan.in.its.present.state=You cannot delete the loan in its current state. It must be pending approval.
|
||||
|
||||
validation.msg.invalid.date.format=Invalid date format.
|
||||
validation.msg.invalid.number.format=Invalid number format.
|
||||
validation.msg.loan.id.is.invalid=Loan identifier is invalid.
|
||||
validation.msg.loan.transaction.id.is.invalid=Loan transaction identifier is invalid.
|
||||
|
||||
validation.msg.loan.state.transition.date.cannot.be.blank=A date must be provided when transitioning the loan into this state.
|
||||
validation.msg.note.exceeds.max.length=The content of the note exceeds max length of 1000 characters.
|
||||
|
||||
validation.msg.loan.repayment.date.cannot.be.blank=The repayment date cannot be blank.
|
||||
validation.msg.loan.repayment.must.be.greater.than.zero=The repayment amount must be a number greater than zero.
|
||||
validation.msg.loan.adjustment.must.be.zero.or.greater=The repayment amount must be a number greater than or equal to zero.
|
||||
|
||||
# loan event and transactions screens
|
||||
label.loan.action.note=Note:
|
||||
dialog.title.reject.loan=Reject loan
|
||||
label.loan.rejected.on=Rejected on:
|
||||
dialog.title.loan.withdrawn.by.client=Withdrawn by client
|
||||
label.loan.withdrawn.by.client.on=Withdrawn on:
|
||||
dialog.title.approve.loan=Approve loan
|
||||
label.loan.approved.on=Approved on:
|
||||
dialog.title.undo.loan.approval=Undo loan approval: confirmation required
|
||||
dialog.title.disburse.loan=Disburse loan
|
||||
label.loan.disbursed.on=Disbursed on:
|
||||
dialog.title.undo.loan.disbursal=Undo loan disbursal: confirmation required
|
||||
dialog.title.loan.repayment=Loan repayment
|
||||
dialog.title.adjust.loan.repayment=Adjust loan repayment
|
||||
dialog.title.waive.loan=Waive outstanding amount
|
||||
label.loan.transaction.on=Repayment on:
|
||||
label.loan.transaction.amount=Amount:
|
||||
|
||||
|
||||
tab.client.account.loan.details=Details
|
||||
tab.client.account.loan.schedule=Schedule
|
||||
tab.client.account.loan.repayments=Repayments
|
||||
|
||||
tab.client.account.loan.schedule.table.summary.caption=Summary
|
||||
tab.client.account.loan.schedule.table.repaymentschedule.caption=Repayment Schedule
|
||||
tab.client.account.loan.schedule.table.repayments.caption=Repayment Activity
|
||||
|
||||
tab.client.account.loan.schedule.table.summary.heading.original=Original Loan
|
||||
tab.client.account.loan.schedule.table.summary.heading.paid=Paid
|
||||
tab.client.account.loan.schedule.table.summary.heading.waived=Waived
|
||||
tab.client.account.loan.schedule.table.heading.outstanding=Outstanding
|
||||
tab.client.account.loan.schedule.table.column.heading.expected=Expected
|
||||
tab.client.account.loan.schedule.table.column.heading.paid=Paid
|
||||
tab.client.account.loan.schedule.table.column.heading.principal=Principal
|
||||
tab.client.account.loan.schedule.table.column.heading.interest=Interest
|
||||
tab.client.account.loan.schedule.table.column.heading.total=Total
|
||||
|
||||
tab.client.account.loan.schedule.table.column.heading.date=Date
|
||||
tab.client.account.loan.schedule.table.column.heading.paymentdate=Payment Date
|
||||
tab.client.account.loan.schedule.table.column.heading.amountpaid=Amount Paid
|
||||
tab.client.account.loan.schedule.table.column.heading.principal.portion=Principal Portion
|
||||
tab.client.account.loan.schedule.table.column.heading.interest.portion=Interest Portion
|
||||
tab.client.account.loan.schedule.table.column.heading.action=Action
|
||||
|
||||
# client account screen
|
||||
label.client.account.loan.status=Status:
|
||||
label.client.account.loan.status.since=since
|
||||
label.client.account.loan.status.arrears=In arrears by:
|
||||
label.client.account.loan.submitted.on=Sumbitted on:
|
||||
label.client.account.loan.approved.on=Approved on:
|
||||
label.client.account.loan.expected.disbursement.on=Expected dibursement on:
|
||||
label.client.account.loan.disbursed.on=Disbursed on:
|
||||
label.client.account.loan.first.repayment.due.on=First repayment due on:
|
||||
label.client.account.loan.interest.charged.from=Interest charged from:
|
||||
label.client.account.loan.expected.maturity.on=Expected to mature on:
|
||||
label.client.account.loan.closed.on=Closed on:
|
||||
label.client.account.loan.term=Expected loan term:
|
||||
label.client.account.loan.actual.term=Actual loan term:
|
||||
label.months=Months
|
||||
label.days=Days
|
||||
label.client.account.loan.product=Product:
|
||||
label.client.account.loan.externalid=External id:
|
||||
label.client.account.loan.currency=Currency:
|
||||
label.client.account.loan.principal=Principal:
|
||||
label.client.account.loan.repayments=Repayments:
|
||||
label.client.account.loan.amortization=Amortization:
|
||||
label.client.account.loan.interest=Interest:
|
||||
|
||||
# organisation administration screens
|
||||
administration.link.view.products=View Products
|
||||
administration.link.add.product=Add Product
|
||||
administration.link.view.offices=View Offices
|
||||
administration.link.add.office=Add Office
|
||||
administration.link.currency.configuration=Currency Configuration
|
||||
|
||||
administration.link.view.users=View Users
|
||||
administration.link.add.user=Add User
|
||||
administration.link.view.roles=View Roles
|
||||
administration.link.add.role=Add Role
|
||||
administration.link.view.permissions=View Permissions
|
||||
|
||||
table.heading.product.name=Product Name
|
||||
table.heading.product.created=Created
|
||||
table.heading.product.modified=Last Modified
|
||||
table.heading.product.active=Active
|
||||
|
||||
link.action.product.deactivate=Deactivate
|
||||
link.action.product.viewedit=View/Edit
|
||||
link.action.product.delete=Delete
|
||||
|
||||
dialog.title.add.loan.product=Add loan product
|
||||
dialog.title.product.details=Loan product details
|
||||
|
||||
form.label.loan.applicant=Applicant:
|
||||
form.label.loan.submitted.on=Submitted on:
|
||||
form.label.loan.submitted.on.note=Loan submittal note:
|
||||
form.label.loan.annual.nominal.interestrate=Annual nominal rate %:
|
||||
form.label.loan.interest.charged.from=Interest charged from:
|
||||
form.label.loan.expected.disbursement.date.on=Expected disbursement on:
|
||||
form.label.loan.first.repayment.on=First repayment on:
|
||||
|
||||
validation.msg.loan.expectedDisbursementDate.method.cannot.be.blank=Expected disbursement on field cannot be blank.
|
||||
validation.msg.loan.expectedDisbursementDate.cannot.be.after.first.repayment.date=Expected disbursement date cannot be after the first repayment date.
|
||||
validation.msg.loan.interestCalculatedFromDate.must.be.entered.when.using.repayments.startfrom.field=The date interest is to be calculated from cannot be left blank when a date is provided for when repayments start from.
|
||||
validation.msg.loan.submitted.on.date.cannot.be.blank=Submitted on date cannot be blank.
|
||||
validation.msg.loan.submitted.on.date.cannot.be.after.expectedDisbursementDate=Submitted on date cannot be after the expected disbursement date.
|
||||
|
||||
form.legend.loan.information=Loan Information
|
||||
form.legend.loan.product.information=Loan Product Information
|
||||
form.label.product.dropdown=Product:
|
||||
form.option.product.dropdown.first.choice=--Select Product--
|
||||
form.label.loan.product.name=Name:
|
||||
form.label.loan.product.description=Description:
|
||||
form.legend.loan.product.currency=Currency
|
||||
form.label.loan.product.currency=Currency:
|
||||
form.label.loan.product.decimalplaces=Decimal places:
|
||||
form.legend.loan.product.loan.terms=Loan Terms
|
||||
form.label.loan.product.loan.amount=Loan amount:
|
||||
form.label.loan.product.repaidevery=Repaid every:
|
||||
form.label.loan.product.numberof.repayments=# of repayments:
|
||||
form.label.loan.product.amortization=Amortization:
|
||||
form.label.loan.product.arrears.tolerance=Arrears tolerance:
|
||||
form.label.loan.product.nominal.interestrate=Nominal interest rate %:
|
||||
form.label.loan.product.interest.method=Interest method:
|
||||
|
||||
validation.msg.product.name.cannot.be.blank=Product name cannot be blank.
|
||||
validation.msg.product.description.exceeds.max.length=The content of the description has exceeded max allowed length of 500 characters.
|
||||
validation.msg.product.currency.digitsAfterDecimal.cannot.be.empty=You must enter a number to represent number of digits after decimal to be supported for product.
|
||||
validation.msg.product.principal.amount.cannot.be.empty=Loan amount cannot be blank.
|
||||
validation.msg.product.repayment.repaidEvery.cannot.be.empty=Repaid every cannot be blank.
|
||||
validation.msg.product.number.of.repayments.cannot.be.empty=# of repayments cannot be blank.
|
||||
validation.msg.product.arrears.tolerance.amount.cannot.be.empty=Arrears tolerance cannot be blank.
|
||||
validation.msg.product.interest.rate.per.period.amount.cannot.be.empty=Nominal interest rate % cannot be blank.
|
||||
|
||||
validation.msg.product.currency.digitsAfterDecimal.must.be.between.zero.and.six.inclusive=Decimal places must be a number between zero and six inclusive.
|
||||
validation.msg.product.principal.amount.must.be.greater.than.zero=Loan amount must be greater than zero.
|
||||
validation.msg.product.repayment.repaidEvery.outside.allowed.range=Repaid every is out of allowed range for selected repayment frequency type.
|
||||
validation.msg.product.number.of.repayments.is.out.of.range=# of repayments is out of allowed range for selected repayment frequency type.
|
||||
validation.msg.product.arrears.tolerance.amount.cannot.be.negative=Arrears tolerance cannot be negative.
|
||||
validation.msg.product.interest.rate.per.period.amount.cannot.be.negative=Nominal interest rate % cannot be negative.
|
||||
|
||||
table.heading.office.name=Office Name
|
||||
table.heading.office.externalid=External Id
|
||||
table.heading.office.openedon=Opened on
|
||||
table.heading.office.parent=Parent Office
|
||||
|
||||
dialog.title.add.office=Add office
|
||||
dialog.title.office.details=Office details
|
||||
|
||||
form.legend.office.details=Office details
|
||||
form.label.office.name=Name:
|
||||
form.label.office.parent=Parent office:
|
||||
form.label.office.openedon=Opened on:
|
||||
form.label.office.externalid=External id:
|
||||
|
||||
validation.msg.office.name.cannot.be.blank=Office name cannot be blank.
|
||||
validation.msg.office.parent.cannot.be.blank=You must select a parent office.
|
||||
validation.msg.office.opening.date.cannot.be.blank=You must choose a date to represent when the office commenced services.
|
||||
|
||||
dialog.title.configuration.currencies=Currency Configuration
|
||||
form.label.configuration.available.currencies=Available currencies:
|
||||
form.label.configuration.allowed.currencies=Allowed currencies:
|
||||
|
||||
validation.msg.organisation.allowed.currencies.cannot.be.blank=You must select at least one currency that is 'allowed' for your organisation.
|
||||
|
||||
# user account settings and admin screens
|
||||
tab.settings=Settings
|
||||
dialog.title.update.password=Update password
|
||||
dialog.title.update.details=Update details
|
||||
|
||||
form.label.new.password=New password:
|
||||
form.label.repeat.new.password=Repeat new password:
|
||||
|
||||
form.label.username=Username:
|
||||
form.label.firstname=First name:
|
||||
form.label.lastname=Last name:
|
||||
form.label.email=Email:
|
||||
|
||||
form.label.heading.office=Office:
|
||||
form.label.office=Office:
|
||||
|
||||
form.label.heading.details=Details:
|
||||
form.label.name=Name:
|
||||
form.label.username=Username:
|
||||
form.label.email=Email:
|
||||
form.link.changedetails=Change details
|
||||
|
||||
form.label.heading.security=Security:
|
||||
form.label.password=Password:
|
||||
form.link.changepassword=Change password
|
||||
|
||||
form.label.heading.roles=Roles:
|
||||
|
||||
error.msg.username.already.exists.in.organisation=An account with that username already exists.
|
||||
|
||||
validation.msg.user.username.cannot.be.blank=Username cannot be blank.
|
||||
validation.msg.username.already.exists.in.organisation=An account with that username already exists.
|
||||
validation.msg.user.firstname.cannot.be.blank=Firstname cannot be blank.
|
||||
validation.msg.user.lastname.cannot.be.blank=Lastname cannot be blank.
|
||||
validation.msg.user.email.cannot.be.blank=Email cannot be blank.
|
||||
validation.msg.user.office.cannot.be.blank=You must select an office.
|
||||
validation.msg.user.roles.cannot.be.blank=A user must have at least one role.
|
||||
validation.msg.changepassword.password.cannot.be.blank=Password cannot be blank.
|
||||
validation.msg.changepassword.passwordrepeat.cannot.be.blank=Repeated password cannot be blank.
|
||||
validation.msg.changepassword.passwordrepeat.not.the.same=Password and Repeat password are not the same.
|
||||
|
||||
dialog.title.add.user=Add user
|
||||
dialog.title.add.role=Add role
|
||||
dialog.title.edit.details=Edit details
|
||||
|
||||
form.legend.role.details=Role Details
|
||||
form.label.role.name=Name:
|
||||
form.label.role.description=Description:
|
||||
form.label.role.available.permissions=Available permissions:
|
||||
form.label.role.selected.permissions=Selected permissions:
|
||||
|
||||
form.legend.user.details=User Details
|
||||
form.label.user.username=Username:
|
||||
form.label.user.firstname=First name:
|
||||
form.label.user.lastname=Last name:
|
||||
form.label.user.email=Email:
|
||||
form.label.user.office=Office:
|
||||
form.label.user.available.roles=Available roles:
|
||||
form.label.user.selected.roles=Selected roles:
|
||||
|
||||
validation.msg.role.name.cannot.be.blank=Name cannot be blank.
|
||||
validation.msg.role.description.cannot.be.blank=Description cannot be blank.
|
||||
validation.msg.role.description.exceeds.max.length=The content of the description exceeds max allowed length of 500 characters.
|
||||
validation.msg.role.permissions.cannot.be.empty=A role must have at least one permission associated with it.
|
||||
|
||||
table.heading.officename=Office Name
|
||||
table.heading.username=Username
|
||||
table.heading.name=Name
|
||||
table.heading.email=Email
|
||||
table.heading.rolename=Role Name
|
||||
table.heading.description=Description
|
||||
table.heading.permission.type=Type
|
||||
table.heading.permission.permission=Permission
|
||||
table.heading.permission.description=Description
|
||||
+352
@@ -0,0 +1,352 @@
|
||||
app.name=Mifos - Individual Lending (fr):
|
||||
|
||||
link.topnav.clients=Clients(fr)
|
||||
link.topnav.users=User Administration(fr)
|
||||
link.topnav.organisation=Organisation Administration(fr)
|
||||
link.reports=Reports(fr)
|
||||
link.signout=Sign out(fr)
|
||||
link.topnav.account.settings=Account Settings(fr)
|
||||
link.topnav.theme=Theme(fr)
|
||||
link.topnav.culture=Culture(fr)
|
||||
|
||||
page.home.title=Home(fr)
|
||||
tab.search=Search(fr)
|
||||
label.client.search=Choose client:(fr):
|
||||
option.client.search.first.choice=--Select Client--(fr)
|
||||
link.add.new.client=Add a new client(fr)
|
||||
|
||||
page.client.account.title=View Client Account Details(fr)
|
||||
page.admin.home.title=Administration Home(fr)
|
||||
page.admin.settings.title=Account Settings(fr)
|
||||
|
||||
dialog.title.add.client=Add client(fr)
|
||||
label.office=Office(fr):
|
||||
option.office.first.choice=--Select Office--(fr)
|
||||
label.lastname=Last name(fr):
|
||||
label.firstname=First name(fr):
|
||||
label.longname=Full name:(fr)
|
||||
label.joiningdate=Joining date(fr):
|
||||
|
||||
error.msg.header=You have the following errors:(fr)
|
||||
validation.msg.client.office.cannot.be.blank=A client must be associated with an office.(fr)
|
||||
validation.msg.client.firstname.cannot.be.blank=First name cannot be blank.(fr)
|
||||
validation.msg.client.lastname.cannot.be.blank=Last name cannot be blank.(fr)
|
||||
validation.msg.client.joining.date.cannot.be.blank=Joining date cannot be blank.(fr)
|
||||
validation.msg.client.fullname.must.be.provide.or.firstname.lastname=A fullname must be provided or else both firstname and lastname details.(fr)
|
||||
validation.msg.client.fullname.cannot.entered.when.firstname.or.lastname.entered=You cannot provide both fullname and firstname or lastname details. A fullname must be provided or else both firstname and lastname details.(fr)
|
||||
|
||||
|
||||
error.msg.client.id.invalid=Client does not exist.(fr)
|
||||
error.msg.office.id.invalid=Office does not exist.(fr)
|
||||
error.msg.office.duplicate.externalId=An office with 'External Id' already exists.(fr)
|
||||
error.msg.office.duplicate.name=An office with 'name' already exists.(fr)
|
||||
error.msg.office.unknown.data.integretity.issue=An unknown data integrity issue occured.(fr)
|
||||
|
||||
dialog.title.confirmation.required=Confirmation required(fr)
|
||||
text.confirmation.required=Are you sure?(fr)
|
||||
dialog.title.functionality.not.available=Functionality not yet available(fr)
|
||||
dialog.messages.functionality.not.available=Functionality not yet available.(fr)
|
||||
|
||||
dialog.button.submit=Submit(fr)
|
||||
dialog.button.save=Save(fr)
|
||||
dialog.button.cancel=Cancel(fr)
|
||||
dialog.button.ok=Ok(fr)
|
||||
dialog.button.confirm=Confirm(fr)
|
||||
link.edit=Edit(fr)
|
||||
widget.multiselect.button.add=Add(fr)
|
||||
widget.multiselect.button.remove=Remove(fr)
|
||||
|
||||
dialog.title.new.loan.application=New loan application(fr)
|
||||
dialog.button.new.loan.application=New loan application(fr)
|
||||
dialog.button.reject.loan=Reject(fr)
|
||||
dialog.button.withdrawn.by.client.loan=Withdrawn by applicant(fr)
|
||||
dialog.button.approve.loan=Approve(fr)
|
||||
dialog.button.delete.loan=Delete(fr)
|
||||
dialog.button.undo.loan.approval=Undo approval(fr)
|
||||
dialog.button.undo.loan.disbursal=Undo disbursal(fr)
|
||||
dialog.button.disburse.loan=Disburse(fr)
|
||||
dialog.button.loan.repayment=Loan repayment(fr)
|
||||
dialog.button.adjust.loan.repayment=Adjust(fr)
|
||||
dialog.button.loan.waive=Waive(fr)
|
||||
|
||||
dialog.button.add.note=Add note(fr)
|
||||
label.client.account.name=Name:(fr)
|
||||
label.client.account.branch=Branch:(fr)
|
||||
label.client.account.joinedon=Joined on:(fr)
|
||||
heading.client.account.account.overview=Account Overview(fr)
|
||||
label.client.account.pending.approval.loans=Pending approval loans(fr)
|
||||
label.client.account.pending.disbursal.loans=Awaiting disbursal loans(fr)
|
||||
label.client.account.active.loans=Active loans(fr)
|
||||
label.client.account.closed.loans=Closed loans(fr)
|
||||
label.client.account.no.loans.exist=No accounts exist(fr)
|
||||
heading.client.account.extra.information=Additional Information(fr)
|
||||
dialog.title.edit.additional.client.information=Edit additional client information(fr)
|
||||
|
||||
widget.notes.heading=You have the following notes:(fr)
|
||||
widget.notes.label.client.note=Client note:(fr)
|
||||
widget.notes.label.loan.note=Loan note:(fr)
|
||||
widget.notes.label.loan.transaction.note=Loan transaction note:(fr)
|
||||
|
||||
dialog.title.add.note=Add note(fr)
|
||||
dialog.title.edit.note=Edit note(fr)
|
||||
dialog.notes.form.label.note=Note:(fr)
|
||||
|
||||
# error handling messages for loan event and transactions screens
|
||||
error.msg.no.loan.with.identifier.exists=No loan with identifier {0} exists.(fr)
|
||||
error.msg.no.permission=You do not have sufficient permissions to perform this action.(fr)
|
||||
error.msg.no.permission.to.approve.loan.in.past=You do not have permission to approve a loan with a date in the past.(fr)
|
||||
error.msg.no.permission.to.reject.loan.in.past=You do not have permission to reject a loan with a date in the past.(fr)
|
||||
error.msg.no.permission.to.withdraw.loan.in.past=You do not have permission to withdraw a loan with a date in the past.(fr)
|
||||
error.msg.no.permission.to.disburse.loan.in.past=You do not have permission to disburse a loan with a date in the past.(fr)
|
||||
error.msg.no.permission.to.make.repayment.on.loan.in.past=You do not have permission to make a repayment on the loan with a date in the past.(fr)
|
||||
error.msg.cannot.delete.loan.in.its.present.state=You cannot delete the loan in its current state. It must be pending approval.(fr)
|
||||
|
||||
validation.msg.invalid.date.format=Invalid date format.(fr)
|
||||
validation.msg.invalid.number.format=Invalid number format.(fr)
|
||||
validation.msg.loan.id.is.invalid=Loan identifier is invalid.(fr)
|
||||
validation.msg.loan.transaction.id.is.invalid=Loan transaction identifier is invalid.(fr)
|
||||
|
||||
validation.msg.loan.state.transition.date.cannot.be.blank=A date must be provided when transitioning the loan into this state.(fr)
|
||||
validation.msg.note.exceeds.max.length=The content of the note exceeds max length of 1000 characters.(fr)
|
||||
|
||||
validation.msg.loan.repayment.date.cannot.be.blank=The repayment date cannot be blank.(fr)
|
||||
validation.msg.loan.repayment.must.be.greater.than.zero=The repayment amount must be a number greater than zero.(fr)
|
||||
validation.msg.loan.adjustment.must.be.zero.or.greater=The repayment amount must be a number greater than or equal to zero.(fr)
|
||||
|
||||
# loan event and transactions screens
|
||||
label.loan.action.note=Note:(fr)
|
||||
dialog.title.reject.loan=Reject loan(fr)
|
||||
label.loan.rejected.on=Rejected on:(fr)
|
||||
dialog.title.loan.withdrawn.by.client=Withdrawn by client(fr)
|
||||
label.loan.withdrawn.by.client.on=Withdrawn on:(fr)
|
||||
dialog.title.approve.loan=Approve loan(fr)
|
||||
label.loan.approved.on=Approved on:(fr)
|
||||
dialog.title.undo.loan.approval=Undo loan approval: confirmation required(fr)
|
||||
dialog.title.disburse.loan=Disburse loan(fr)
|
||||
label.loan.disbursed.on=Disbursed on:(fr)
|
||||
dialog.title.undo.loan.disbursal=Undo loan disbursal: confirmation required(fr)
|
||||
dialog.title.loan.repayment=Loan repayment(fr)
|
||||
dialog.title.adjust.loan.repayment=Adjust loan repayment(fr)
|
||||
dialog.title.waive.loan=Waive outstanding amount(fr)
|
||||
label.loan.transaction.on=Repayment on:(fr)
|
||||
label.loan.transaction.amount=Amount:(fr)
|
||||
|
||||
tab.client.account.loan.details=Details(fr)
|
||||
tab.client.account.loan.schedule=Schedule(fr)
|
||||
tab.client.account.loan.repayments=Repayments(fr)
|
||||
|
||||
tab.client.account.loan.schedule.table.summary.caption=Summary(fr)
|
||||
tab.client.account.loan.schedule.table.repaymentschedule.caption=Repayment Schedule(fr)
|
||||
tab.client.account.loan.schedule.table.repayments.caption=Repayment Activity(fr)
|
||||
|
||||
tab.client.account.loan.schedule.table.summary.heading.original=Original Loan(fr)
|
||||
tab.client.account.loan.schedule.table.summary.heading.paid=Paid(fr)
|
||||
tab.client.account.loan.schedule.table.summary.heading.waived=Waived(fr)
|
||||
tab.client.account.loan.schedule.table.heading.outstanding=Outstanding(fr)
|
||||
tab.client.account.loan.schedule.table.column.heading.expected=Expected(fr)
|
||||
tab.client.account.loan.schedule.table.column.heading.paid=Paid(fr)
|
||||
tab.client.account.loan.schedule.table.column.heading.principal=Principal(fr)
|
||||
tab.client.account.loan.schedule.table.column.heading.interest=Interest(fr)
|
||||
tab.client.account.loan.schedule.table.column.heading.total=Total(fr)
|
||||
|
||||
tab.client.account.loan.schedule.table.column.heading.date=Date(fr)
|
||||
tab.client.account.loan.schedule.table.column.heading.paymentdate=Payment Date(fr)
|
||||
tab.client.account.loan.schedule.table.column.heading.amountpaid=Amount Paid(fr)
|
||||
tab.client.account.loan.schedule.table.column.heading.principal.portion=Principal Portion(fr)
|
||||
tab.client.account.loan.schedule.table.column.heading.interest.portion=Interest Portion(fr)
|
||||
tab.client.account.loan.schedule.table.column.heading.action=Action(fr)
|
||||
|
||||
# client account screen
|
||||
label.client.account.loan.status=Status:(fr)
|
||||
label.client.account.loan.status.since=since(fr)
|
||||
label.client.account.loan.status.arrears=In arrears by:(fr)
|
||||
label.client.account.loan.submitted.on=Sumbitted on:(fr)
|
||||
label.client.account.loan.approved.on=Approved on:(fr)
|
||||
label.client.account.loan.expected.disbursement.on=Expected dibursement on:(fr)
|
||||
label.client.account.loan.disbursed.on=Disbursed on:(fr)
|
||||
label.client.account.loan.first.repayment.due.on=First repayment due on:(fr)
|
||||
label.client.account.loan.interest.charged.from=Interest charged from:(fr)
|
||||
label.client.account.loan.expected.maturity.on=Expected to mature on:(fr)
|
||||
label.client.account.loan.closed.on=Closed on:(fr)
|
||||
label.client.account.loan.term=Expected loan term:(fr)
|
||||
label.client.account.loan.actual.term=Actual loan term:(fr)
|
||||
label.months=Months(fr)
|
||||
label.days=Days(fr)
|
||||
label.client.account.loan.product=Product:(fr)
|
||||
label.client.account.loan.externalid=External id:(fr)
|
||||
label.client.account.loan.currency=Currency:(fr)
|
||||
label.client.account.loan.principal=Principal:(fr)
|
||||
label.client.account.loan.repayments=Repayments:(fr)
|
||||
label.client.account.loan.amortization=Amortization:(fr)
|
||||
label.client.account.loan.interest=Interest:(fr)
|
||||
|
||||
# organisation administration screens
|
||||
administration.link.view.products=View Products(fr)
|
||||
administration.link.add.product=Add Product(fr)
|
||||
administration.link.view.offices=View Offices(fr)
|
||||
administration.link.add.office=Add Office(fr)
|
||||
administration.link.currency.configuration=Currency Configuration(fr)
|
||||
|
||||
administration.link.view.users=View Users(fr)
|
||||
administration.link.add.user=Add User(fr)
|
||||
administration.link.view.roles=View Roles(fr)
|
||||
administration.link.add.role=Add Role(fr)
|
||||
administration.link.view.permissions=View Permissions(fr)
|
||||
|
||||
table.heading.product.name=Product Name(fr)
|
||||
table.heading.product.created=Created(fr)
|
||||
table.heading.product.modified=Last Modified(fr)
|
||||
table.heading.product.active=Active(fr)
|
||||
|
||||
link.action.product.deactivate=Deactivate(fr)
|
||||
link.action.product.viewedit=View/Edit(fr)
|
||||
link.action.product.delete=Delete(fr)
|
||||
|
||||
dialog.title.add.loan.product=Add loan product(fr)
|
||||
dialog.title.product.details=Loan product details(fr)
|
||||
|
||||
form.label.loan.applicant=Applicant:(fr)
|
||||
form.label.loan.submitted.on=Submitted on:(fr)
|
||||
form.label.loan.submitted.on.note=Loan submittal note:(fr)
|
||||
form.label.loan.annual.nominal.interestrate=Annual nominal rate %:(fr)
|
||||
form.label.loan.interest.charged.from=Interest charged from:(fr)
|
||||
form.label.loan.expected.disbursement.date.on=Expected disbursement on:(fr)
|
||||
form.label.loan.first.repayment.on=First repayment on:(fr)
|
||||
|
||||
validation.msg.loan.expectedDisbursementDate.method.cannot.be.blank=Expected disbursement on field cannot be blank.(fr)
|
||||
validation.msg.loan.expectedDisbursementDate.cannot.be.after.first.repayment.date=Expected disbursement date cannot be after the first repayment date.(fr)
|
||||
validation.msg.loan.interestCalculatedFromDate.must.be.entered.when.using.repayments.startfrom.field=The date interest is to be calculated from cannot be left blank when a date is provided for when repayments start from.(fr)
|
||||
validation.msg.loan.submitted.on.date.cannot.be.blank=Submitted on date cannot be blank.(fr)
|
||||
validation.msg.loan.submitted.on.date.cannot.be.after.expectedDisbursementDate=Submitted on date cannot be after the expected disbursement date.(fr)
|
||||
|
||||
form.legend.loan.information=Loan Information(fr)
|
||||
form.legend.loan.product.information=Loan Product Information(fr)
|
||||
form.label.product.dropdown=Product:(fr)
|
||||
form.option.product.dropdown.first.choice=--Select Product--(fr)
|
||||
form.label.loan.product.name=Name:(fr)
|
||||
form.label.loan.product.description=Description:(fr)
|
||||
form.legend.loan.product.currency=Currency(fr)
|
||||
form.label.loan.product.currency=Currency:(fr)
|
||||
form.label.loan.product.decimalplaces=Decimal places:(fr)
|
||||
form.legend.loan.product.loan.terms=Loan Terms(fr)
|
||||
form.label.loan.product.loan.amount=Loan amount:(fr)
|
||||
form.label.loan.product.repaidevery=Repaid every:(fr)
|
||||
form.label.loan.product.numberof.repayments=# of repayments:(fr)
|
||||
form.label.loan.product.amortization=Amortization:(fr)
|
||||
form.label.loan.product.arrears.tolerance=Arrears tolerance:(fr)
|
||||
form.label.loan.product.nominal.interestrate=Nominal interest rate %:(fr)
|
||||
form.label.loan.product.interest.method=Interest method:(fr)
|
||||
|
||||
validation.msg.product.name.cannot.be.blank=Product name cannot be blank.(fr)
|
||||
validation.msg.product.description.exceeds.max.length=The content of the description has exceeded max allowed length of 500 characters.(fr)
|
||||
validation.msg.product.currency.digitsAfterDecimal.cannot.be.empty=You must enter a number to represent number of digits after decimal to be supported for product.(fr)
|
||||
validation.msg.product.principal.amount.cannot.be.empty=Loan amount cannot be blank.(fr)
|
||||
validation.msg.product.repayment.repaidEvery.cannot.be.empty=Repaid every cannot be blank.(fr)
|
||||
validation.msg.product.number.of.repayments.cannot.be.empty=# of repayments cannot be blank.(fr)
|
||||
validation.msg.product.arrears.tolerance.amount.cannot.be.empty=Arrears tolerance cannot be blank.(fr)
|
||||
validation.msg.product.interest.rate.per.period.amount.cannot.be.empty=Nominal interest rate % cannot be blank.(fr)
|
||||
|
||||
validation.msg.product.currency.digitsAfterDecimal.must.be.between.zero.and.six.inclusive=Decimal places must be a number between zero and six inclusive.(fr)
|
||||
validation.msg.product.principal.amount.must.be.greater.than.zero=Loan amount must be greater than zero.(fr)
|
||||
validation.msg.product.repayment.repaidEvery.outside.allowed.range=Repaid every is out of allowed range for selected repayment frequency type.(fr)
|
||||
validation.msg.product.number.of.repayments.is.out.of.range=# of repayments is out of allowed range for selected repayment frequency type.(fr)
|
||||
validation.msg.product.arrears.tolerance.amount.cannot.be.negative=Arrears tolerance cannot be negative.(fr)
|
||||
validation.msg.product.interest.rate.per.period.amount.cannot.be.negative=Nominal interest rate % cannot be negative.(fr)
|
||||
|
||||
table.heading.office.name=Office Name(fr)
|
||||
table.heading.office.externalid=External Id(fr)
|
||||
table.heading.office.openedon=Opened on(fr)
|
||||
table.heading.office.parent=Parent Office(fr)
|
||||
|
||||
dialog.title.add.office=Add office(fr)
|
||||
dialog.title.office.details=Office details(fr)
|
||||
|
||||
form.legend.office.details=Office details(fr)
|
||||
form.label.office.name=Name:(fr)
|
||||
form.label.office.parent=Parent office:(fr)
|
||||
form.label.office.openedon=Opened on:(fr)
|
||||
form.label.office.externalid=External id:(fr)
|
||||
|
||||
validation.msg.office.name.cannot.be.blank=Office name cannot be blank.(fr)
|
||||
validation.msg.office.parent.cannot.be.blank=You must select a parent office.(fr)
|
||||
validation.msg.office.opening.date.cannot.be.blank=You must choose a date to represent when the office commenced services.(fr)
|
||||
|
||||
form.label.configuration.available.currencies=Available currencies:(fr)
|
||||
form.label.configuration.allowed.currencies=Allowed currencies:(fr)
|
||||
|
||||
validation.msg.organisation.allowed.currencies.cannot.be.blank=You must select at least one currency that is 'allowed' for your organisation.(fr)
|
||||
|
||||
# user account settings and admin screens
|
||||
tab.settings=Settings(fr)
|
||||
dialog.title.update.password=Update password(fr)
|
||||
dialog.title.update.details=Update details(fr)
|
||||
|
||||
form.label.new.password=New password:(fr)
|
||||
form.label.repeat.new.password=Repeat new password:(fr)
|
||||
|
||||
form.label.username=Username:(fr)
|
||||
form.label.firstname=First name:(fr)
|
||||
form.label.lastname=Last name:(fr)
|
||||
form.label.email=Email:(fr)
|
||||
|
||||
form.label.heading.office=Office:(fr)
|
||||
form.label.office=Office:(fr)
|
||||
|
||||
form.label.heading.details=Details:(fr)
|
||||
form.label.name=Name:(fr)
|
||||
form.label.username=Username:(fr)
|
||||
form.label.email=Email:(fr)
|
||||
form.link.changedetails=Change details(fr)
|
||||
|
||||
form.label.heading.security=Security:(fr)
|
||||
form.label.password=Password:(fr)
|
||||
form.link.changepassword=Change password(fr)
|
||||
|
||||
form.label.heading.roles=Roles:(fr)
|
||||
|
||||
error.msg.username.already.exists.in.organisation=An account with that username already exists.(fr)
|
||||
|
||||
validation.msg.user.username.cannot.be.blank=Username cannot be blank.(fr)
|
||||
validation.msg.username.already.exists.in.organisation=An account with that username already exists.(fr)
|
||||
validation.msg.user.firstname.cannot.be.blank=Firstname cannot be blank.(fr)
|
||||
validation.msg.user.lastname.cannot.be.blank=Lastname cannot be blank.(fr)
|
||||
validation.msg.user.email.cannot.be.blank=Email cannot be blank.(fr)
|
||||
validation.msg.user.office.cannot.be.blank=You must select an office.(fr)
|
||||
validation.msg.user.roles.cannot.be.blank=A user must have at least one role.(fr)
|
||||
validation.msg.changepassword.password.cannot.be.blank=Password cannot be blank.(fr)
|
||||
validation.msg.changepassword.passwordrepeat.cannot.be.blank=Repeated password cannot be blank.(fr)
|
||||
validation.msg.changepassword.passwordrepeat.not.the.same=Password and Repeat password are not the same.(fr)
|
||||
|
||||
dialog.title.add.user=Add user(fr)
|
||||
dialog.title.add.role=Add role(fr)
|
||||
dialog.title.edit.details=Edit details(fr)
|
||||
|
||||
form.legend.role.details=Role Details(fr)
|
||||
form.label.role.name=Name:(fr)
|
||||
form.label.role.description=Description:(fr)
|
||||
form.label.role.available.permissions=Available permissions:(fr)
|
||||
form.label.role.selected.permissions=Selected permissions:(fr)
|
||||
|
||||
form.legend.user.details=User Details(fr)
|
||||
form.label.user.username=Username:(fr)
|
||||
form.label.user.firstname=First name:(fr)
|
||||
form.label.user.lastname=Last name:(fr)
|
||||
form.label.user.email=Email:(fr)
|
||||
form.label.user.office=Office:(fr)
|
||||
form.label.user.available.roles=Available roles:(fr)
|
||||
form.label.user.selected.roles=Selected roles:(fr)
|
||||
|
||||
validation.msg.role.name.cannot.be.blank=Name cannot be blank.(fr)
|
||||
validation.msg.role.description.cannot.be.blank=Description cannot be blank.(fr)
|
||||
validation.msg.role.description.exceeds.max.length=The content of the description exceeds max allowed length of 500 characters.(fr)
|
||||
validation.msg.role.permissions.cannot.be.empty=A role must have at least one permission associated with it.(fr)
|
||||
|
||||
table.heading.officename=Office Name(fr)
|
||||
table.heading.username=Username(fr)
|
||||
table.heading.name=Name(fr)
|
||||
table.heading.email=Email(fr)
|
||||
table.heading.rolename=Role Name(fr)
|
||||
table.heading.description=Description(fr)
|
||||
table.heading.permission.type=Type(fr)
|
||||
table.heading.permission.permission=Permission(fr)
|
||||
table.heading.permission.description=Description(fr)
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Globalize Culture af-ZA
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "af-ZA", "default", {
|
||||
name: "af-ZA",
|
||||
englishName: "Afrikaans (South Africa)",
|
||||
nativeName: "Afrikaans (Suid Afrika)",
|
||||
language: "af",
|
||||
numberFormat: {
|
||||
percent: {
|
||||
pattern: ["-n%","n%"]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$-n","$ n"],
|
||||
symbol: "R"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
days: {
|
||||
names: ["Sondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrydag","Saterdag"],
|
||||
namesAbbr: ["Son","Maan","Dins","Woen","Dond","Vry","Sat"],
|
||||
namesShort: ["So","Ma","Di","Wo","Do","Vr","Sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["Januarie","Februarie","Maart","April","Mei","Junie","Julie","Augustus","September","Oktober","November","Desember",""],
|
||||
namesAbbr: ["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des",""]
|
||||
},
|
||||
patterns: {
|
||||
d: "yyyy/MM/dd",
|
||||
D: "dd MMMM yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM yyyy hh:mm tt",
|
||||
F: "dd MMMM yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Globalize Culture af
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "af", "default", {
|
||||
name: "af",
|
||||
englishName: "Afrikaans",
|
||||
nativeName: "Afrikaans",
|
||||
language: "af",
|
||||
numberFormat: {
|
||||
percent: {
|
||||
pattern: ["-n%","n%"]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$-n","$ n"],
|
||||
symbol: "R"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
days: {
|
||||
names: ["Sondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrydag","Saterdag"],
|
||||
namesAbbr: ["Son","Maan","Dins","Woen","Dond","Vry","Sat"],
|
||||
namesShort: ["So","Ma","Di","Wo","Do","Vr","Sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["Januarie","Februarie","Maart","April","Mei","Junie","Julie","Augustus","September","Oktober","November","Desember",""],
|
||||
namesAbbr: ["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des",""]
|
||||
},
|
||||
patterns: {
|
||||
d: "yyyy/MM/dd",
|
||||
D: "dd MMMM yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM yyyy hh:mm tt",
|
||||
F: "dd MMMM yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Globalize Culture am-ET
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "am-ET", "default", {
|
||||
name: "am-ET",
|
||||
englishName: "Amharic (Ethiopia)",
|
||||
nativeName: "አማርኛ (ኢትዮጵያ)",
|
||||
language: "am",
|
||||
numberFormat: {
|
||||
decimals: 1,
|
||||
groupSizes: [3,0],
|
||||
"NaN": "NAN",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
decimals: 1,
|
||||
groupSizes: [3,0]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-$n","$n"],
|
||||
groupSizes: [3,0],
|
||||
symbol: "ETB"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
days: {
|
||||
names: ["እሑድ","ሰኞ","ማክሰኞ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],
|
||||
namesAbbr: ["እሑድ","ሰኞ","ማክሰ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],
|
||||
namesShort: ["እ","ሰ","ማ","ረ","ሐ","ዓ","ቅ"]
|
||||
},
|
||||
months: {
|
||||
names: ["ጃንዩወሪ","ፌብሩወሪ","ማርች","ኤፕረል","ሜይ","ጁን","ጁላይ","ኦገስት","ሴፕቴምበር","ኦክተውበር","ኖቬምበር","ዲሴምበር",""],
|
||||
namesAbbr: ["ጃንዩ","ፌብሩ","ማርች","ኤፕረ","ሜይ","ጁን","ጁላይ","ኦገስ","ሴፕቴ","ኦክተ","ኖቬም","ዲሴም",""]
|
||||
},
|
||||
AM: ["ጡዋት","ጡዋት","ጡዋት"],
|
||||
PM: ["ከሰዓት","ከሰዓት","ከሰዓት"],
|
||||
eras: [{"name":"ዓመተ ምሕረት","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "d/M/yyyy",
|
||||
D: "dddd '፣' MMMM d 'ቀን' yyyy",
|
||||
f: "dddd '፣' MMMM d 'ቀን' yyyy h:mm tt",
|
||||
F: "dddd '፣' MMMM d 'ቀን' yyyy h:mm:ss tt",
|
||||
M: "MMMM d ቀን",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Globalize Culture am
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "am", "default", {
|
||||
name: "am",
|
||||
englishName: "Amharic",
|
||||
nativeName: "አማርኛ",
|
||||
language: "am",
|
||||
numberFormat: {
|
||||
decimals: 1,
|
||||
groupSizes: [3,0],
|
||||
"NaN": "NAN",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
decimals: 1,
|
||||
groupSizes: [3,0]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-$n","$n"],
|
||||
groupSizes: [3,0],
|
||||
symbol: "ETB"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
days: {
|
||||
names: ["እሑድ","ሰኞ","ማክሰኞ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],
|
||||
namesAbbr: ["እሑድ","ሰኞ","ማክሰ","ረቡዕ","ሐሙስ","ዓርብ","ቅዳሜ"],
|
||||
namesShort: ["እ","ሰ","ማ","ረ","ሐ","ዓ","ቅ"]
|
||||
},
|
||||
months: {
|
||||
names: ["ጃንዩወሪ","ፌብሩወሪ","ማርች","ኤፕረል","ሜይ","ጁን","ጁላይ","ኦገስት","ሴፕቴምበር","ኦክተውበር","ኖቬምበር","ዲሴምበር",""],
|
||||
namesAbbr: ["ጃንዩ","ፌብሩ","ማርች","ኤፕረ","ሜይ","ጁን","ጁላይ","ኦገስ","ሴፕቴ","ኦክተ","ኖቬም","ዲሴም",""]
|
||||
},
|
||||
AM: ["ጡዋት","ጡዋት","ጡዋት"],
|
||||
PM: ["ከሰዓት","ከሰዓት","ከሰዓት"],
|
||||
eras: [{"name":"ዓመተ ምሕረት","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "d/M/yyyy",
|
||||
D: "dddd '፣' MMMM d 'ቀን' yyyy",
|
||||
f: "dddd '፣' MMMM d 'ቀን' yyyy h:mm tt",
|
||||
F: "dddd '፣' MMMM d 'ቀን' yyyy h:mm:ss tt",
|
||||
M: "MMMM d ቀን",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
/*
|
||||
* Globalize Culture ar-AE
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-AE", "default", {
|
||||
name: "ar-AE",
|
||||
englishName: "Arabic (U.A.E.)",
|
||||
nativeName: "العربية (الإمارات العربية المتحدة)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "د.إ.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+462
@@ -0,0 +1,462 @@
|
||||
/*
|
||||
* Globalize Culture ar-BH
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-BH", "default", {
|
||||
name: "ar-BH",
|
||||
englishName: "Arabic (Bahrain)",
|
||||
nativeName: "العربية (البحرين)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
decimals: 3,
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
percent: {
|
||||
decimals: 3
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
decimals: 3,
|
||||
symbol: "د.ب.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+458
@@ -0,0 +1,458 @@
|
||||
/*
|
||||
* Globalize Culture ar-DZ
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-DZ", "default", {
|
||||
name: "ar-DZ",
|
||||
englishName: "Arabic (Algeria)",
|
||||
nativeName: "العربية (الجزائر)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "د.ج.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": "-",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd-MM-yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dd MMMM, yyyy H:mm",
|
||||
F: "dd MMMM, yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dd/MM/yyyy H:mm",
|
||||
F: "dd/MM/yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dd/MMMM/yyyy H:mm",
|
||||
F: "dd/MMMM/yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, MMMM dd, yyyy H:mm",
|
||||
F: "dddd, MMMM dd, yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, MMMM dd, yyyy H:mm",
|
||||
F: "dddd, MMMM dd, yyyy H:mm:ss"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedEnglish: {
|
||||
name: "Gregorian_TransliteratedEnglish",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["أ","ا","ث","أ","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, MMMM dd, yyyy H:mm",
|
||||
F: "dddd, MMMM dd, yyyy H:mm:ss"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+484
@@ -0,0 +1,484 @@
|
||||
/*
|
||||
* Globalize Culture ar-EG
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-EG", "default", {
|
||||
name: "ar-EG",
|
||||
englishName: "Arabic (Egypt)",
|
||||
nativeName: "العربية (مصر)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
decimals: 3,
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
percent: {
|
||||
decimals: 3
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "ج.م.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedEnglish: {
|
||||
name: "Gregorian_TransliteratedEnglish",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["أ","ا","ث","أ","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
/*
|
||||
* Globalize Culture ar-IQ
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-IQ", "default", {
|
||||
name: "ar-IQ",
|
||||
englishName: "Arabic (Iraq)",
|
||||
nativeName: "العربية (العراق)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "د.ع.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedEnglish: {
|
||||
name: "Gregorian_TransliteratedEnglish",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["أ","ا","ث","أ","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+462
@@ -0,0 +1,462 @@
|
||||
/*
|
||||
* Globalize Culture ar-JO
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-JO", "default", {
|
||||
name: "ar-JO",
|
||||
englishName: "Arabic (Jordan)",
|
||||
nativeName: "العربية (الأردن)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
decimals: 3,
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
percent: {
|
||||
decimals: 3
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
decimals: 3,
|
||||
symbol: "د.ا.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedEnglish: {
|
||||
name: "Gregorian_TransliteratedEnglish",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["أ","ا","ث","أ","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+462
@@ -0,0 +1,462 @@
|
||||
/*
|
||||
* Globalize Culture ar-KW
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-KW", "default", {
|
||||
name: "ar-KW",
|
||||
englishName: "Arabic (Kuwait)",
|
||||
nativeName: "العربية (الكويت)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
decimals: 3,
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
percent: {
|
||||
decimals: 3
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
decimals: 3,
|
||||
symbol: "د.ك.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
/*
|
||||
* Globalize Culture ar-LB
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-LB", "default", {
|
||||
name: "ar-LB",
|
||||
englishName: "Arabic (Lebanon)",
|
||||
nativeName: "العربية (لبنان)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "ل.ل.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedEnglish: {
|
||||
name: "Gregorian_TransliteratedEnglish",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["أ","ا","ث","أ","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+462
@@ -0,0 +1,462 @@
|
||||
/*
|
||||
* Globalize Culture ar-LY
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-LY", "default", {
|
||||
name: "ar-LY",
|
||||
englishName: "Arabic (Libya)",
|
||||
nativeName: "العربية (ليبيا)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
decimals: 3,
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
percent: {
|
||||
decimals: 3
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$n-","$n"],
|
||||
decimals: 3,
|
||||
symbol: "د.ل.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+458
@@ -0,0 +1,458 @@
|
||||
/*
|
||||
* Globalize Culture ar-MA
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-MA", "default", {
|
||||
name: "ar-MA",
|
||||
englishName: "Arabic (Morocco)",
|
||||
nativeName: "العربية (المملكة المغربية)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "د.م.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": "-",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","ماي","يونيو","يوليوز","غشت","شتنبر","أكتوبر","نونبر","دجنبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","أبريل","ماي","يونيو","يوليوز","غشت","شتنبر","أكتوبر","نونبر","دجنبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd-MM-yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dd MMMM, yyyy H:mm",
|
||||
F: "dd MMMM, yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dd/MM/yyyy H:mm",
|
||||
F: "dd/MM/yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dd/MMMM/yyyy H:mm",
|
||||
F: "dd/MMMM/yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, MMMM dd, yyyy H:mm",
|
||||
F: "dddd, MMMM dd, yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, MMMM dd, yyyy H:mm",
|
||||
F: "dddd, MMMM dd, yyyy H:mm:ss"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedEnglish: {
|
||||
name: "Gregorian_TransliteratedEnglish",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["أ","ا","ث","أ","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, MMMM dd, yyyy H:mm",
|
||||
F: "dddd, MMMM dd, yyyy H:mm:ss"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+458
@@ -0,0 +1,458 @@
|
||||
/*
|
||||
* Globalize Culture ar-OM
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-OM", "default", {
|
||||
name: "ar-OM",
|
||||
englishName: "Arabic (Oman)",
|
||||
nativeName: "العربية (عمان)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
decimals: 3,
|
||||
symbol: "ر.ع.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
/*
|
||||
* Globalize Culture ar-QA
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-QA", "default", {
|
||||
name: "ar-QA",
|
||||
englishName: "Arabic (Qatar)",
|
||||
nativeName: "العربية (قطر)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "ر.ق.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
/*
|
||||
* Globalize Culture ar-SA
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-SA", "default", {
|
||||
name: "ar-SA",
|
||||
englishName: "Arabic (Saudi Arabia)",
|
||||
nativeName: "العربية (المملكة العربية السعودية)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "ر.س.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_Localized: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
/*
|
||||
* Globalize Culture ar-SY
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-SY", "default", {
|
||||
name: "ar-SY",
|
||||
englishName: "Arabic (Syria)",
|
||||
nativeName: "العربية (سوريا)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "ل.س.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedEnglish: {
|
||||
name: "Gregorian_TransliteratedEnglish",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["أ","ا","ث","أ","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+463
@@ -0,0 +1,463 @@
|
||||
/*
|
||||
* Globalize Culture ar-TN
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-TN", "default", {
|
||||
name: "ar-TN",
|
||||
englishName: "Arabic (Tunisia)",
|
||||
nativeName: "العربية (تونس)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
decimals: 3,
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
percent: {
|
||||
decimals: 3
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
decimals: 3,
|
||||
symbol: "د.ت.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": "-",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd-MM-yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dd MMMM, yyyy H:mm",
|
||||
F: "dd MMMM, yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dd/MM/yyyy H:mm",
|
||||
F: "dd/MM/yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dd/MMMM/yyyy H:mm",
|
||||
F: "dd/MMMM/yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, MMMM dd, yyyy H:mm",
|
||||
F: "dddd, MMMM dd, yyyy H:mm:ss",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, MMMM dd, yyyy H:mm",
|
||||
F: "dddd, MMMM dd, yyyy H:mm:ss"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedEnglish: {
|
||||
name: "Gregorian_TransliteratedEnglish",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["أ","ا","ث","أ","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","ابريل","مايو","يونيو","يوليو","اغسطس","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, MMMM dd, yyyy H:mm",
|
||||
F: "dddd, MMMM dd, yyyy H:mm:ss"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
/*
|
||||
* Globalize Culture ar-YE
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar-YE", "default", {
|
||||
name: "ar-YE",
|
||||
englishName: "Arabic (Yemen)",
|
||||
nativeName: "العربية (اليمن)",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "ر.ي.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
UmAlQura: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+457
@@ -0,0 +1,457 @@
|
||||
/*
|
||||
* Globalize Culture ar
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ar", "default", {
|
||||
name: "ar",
|
||||
englishName: "Arabic",
|
||||
nativeName: "العربية",
|
||||
language: "ar",
|
||||
isRTL: true,
|
||||
numberFormat: {
|
||||
pattern: ["n-"],
|
||||
"NaN": "ليس برقم",
|
||||
negativeInfinity: "-لا نهاية",
|
||||
positiveInfinity: "+لا نهاية",
|
||||
currency: {
|
||||
pattern: ["$n-","$ n"],
|
||||
symbol: "ر.س.\u200f"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
name: "UmAlQura",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MMMM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MMMM/yyyy hh:mm tt",
|
||||
F: "dd/MMMM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
_yearInfo: [
|
||||
// MonthLengthFlags, Gregorian Date
|
||||
[746, -2198707200000],
|
||||
[1769, -2168121600000],
|
||||
[3794, -2137449600000],
|
||||
[3748, -2106777600000],
|
||||
[3402, -2076192000000],
|
||||
[2710, -2045606400000],
|
||||
[1334, -2015020800000],
|
||||
[2741, -1984435200000],
|
||||
[3498, -1953763200000],
|
||||
[2980, -1923091200000],
|
||||
[2889, -1892505600000],
|
||||
[2707, -1861920000000],
|
||||
[1323, -1831334400000],
|
||||
[2647, -1800748800000],
|
||||
[1206, -1770076800000],
|
||||
[2741, -1739491200000],
|
||||
[1450, -1708819200000],
|
||||
[3413, -1678233600000],
|
||||
[3370, -1647561600000],
|
||||
[2646, -1616976000000],
|
||||
[1198, -1586390400000],
|
||||
[2397, -1555804800000],
|
||||
[748, -1525132800000],
|
||||
[1749, -1494547200000],
|
||||
[1706, -1463875200000],
|
||||
[1365, -1433289600000],
|
||||
[1195, -1402704000000],
|
||||
[2395, -1372118400000],
|
||||
[698, -1341446400000],
|
||||
[1397, -1310860800000],
|
||||
[2994, -1280188800000],
|
||||
[1892, -1249516800000],
|
||||
[1865, -1218931200000],
|
||||
[1621, -1188345600000],
|
||||
[683, -1157760000000],
|
||||
[1371, -1127174400000],
|
||||
[2778, -1096502400000],
|
||||
[1748, -1065830400000],
|
||||
[3785, -1035244800000],
|
||||
[3474, -1004572800000],
|
||||
[3365, -973987200000],
|
||||
[2637, -943401600000],
|
||||
[685, -912816000000],
|
||||
[1389, -882230400000],
|
||||
[2922, -851558400000],
|
||||
[2898, -820886400000],
|
||||
[2725, -790300800000],
|
||||
[2635, -759715200000],
|
||||
[1175, -729129600000],
|
||||
[2359, -698544000000],
|
||||
[694, -667872000000],
|
||||
[1397, -637286400000],
|
||||
[3434, -606614400000],
|
||||
[3410, -575942400000],
|
||||
[2710, -545356800000],
|
||||
[2349, -514771200000],
|
||||
[605, -484185600000],
|
||||
[1245, -453600000000],
|
||||
[2778, -422928000000],
|
||||
[1492, -392256000000],
|
||||
[3497, -361670400000],
|
||||
[3410, -330998400000],
|
||||
[2730, -300412800000],
|
||||
[1238, -269827200000],
|
||||
[2486, -239241600000],
|
||||
[884, -208569600000],
|
||||
[1897, -177984000000],
|
||||
[1874, -147312000000],
|
||||
[1701, -116726400000],
|
||||
[1355, -86140800000],
|
||||
[2731, -55555200000],
|
||||
[1370, -24883200000],
|
||||
[2773, 5702400000],
|
||||
[3538, 36374400000],
|
||||
[3492, 67046400000],
|
||||
[3401, 97632000000],
|
||||
[2709, 128217600000],
|
||||
[1325, 158803200000],
|
||||
[2653, 189388800000],
|
||||
[1370, 220060800000],
|
||||
[2773, 250646400000],
|
||||
[1706, 281318400000],
|
||||
[1685, 311904000000],
|
||||
[1323, 342489600000],
|
||||
[2647, 373075200000],
|
||||
[1198, 403747200000],
|
||||
[2422, 434332800000],
|
||||
[1388, 465004800000],
|
||||
[2901, 495590400000],
|
||||
[2730, 526262400000],
|
||||
[2645, 556848000000],
|
||||
[1197, 587433600000],
|
||||
[2397, 618019200000],
|
||||
[730, 648691200000],
|
||||
[1497, 679276800000],
|
||||
[3506, 709948800000],
|
||||
[2980, 740620800000],
|
||||
[2890, 771206400000],
|
||||
[2645, 801792000000],
|
||||
[693, 832377600000],
|
||||
[1397, 862963200000],
|
||||
[2922, 893635200000],
|
||||
[3026, 924307200000],
|
||||
[3012, 954979200000],
|
||||
[2953, 985564800000],
|
||||
[2709, 1016150400000],
|
||||
[1325, 1046736000000],
|
||||
[1453, 1077321600000],
|
||||
[2922, 1107993600000],
|
||||
[1748, 1138665600000],
|
||||
[3529, 1169251200000],
|
||||
[3474, 1199923200000],
|
||||
[2726, 1230508800000],
|
||||
[2390, 1261094400000],
|
||||
[686, 1291680000000],
|
||||
[1389, 1322265600000],
|
||||
[874, 1352937600000],
|
||||
[2901, 1383523200000],
|
||||
[2730, 1414195200000],
|
||||
[2381, 1444780800000],
|
||||
[1181, 1475366400000],
|
||||
[2397, 1505952000000],
|
||||
[698, 1536624000000],
|
||||
[1461, 1567209600000],
|
||||
[1450, 1597881600000],
|
||||
[3413, 1628467200000],
|
||||
[2714, 1659139200000],
|
||||
[2350, 1689724800000],
|
||||
[622, 1720310400000],
|
||||
[1373, 1750896000000],
|
||||
[2778, 1781568000000],
|
||||
[1748, 1812240000000],
|
||||
[1701, 1842825600000],
|
||||
[0, 1873411200000]
|
||||
],
|
||||
minDate: -2198707200000,
|
||||
maxDate: 1873411199999,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var days = hday - 1,
|
||||
gyear = hyear - 1318;
|
||||
if (gyear < 0 || gyear >= this._yearInfo.length) return null;
|
||||
var info = this._yearInfo[gyear],
|
||||
gdate = new Date(info[1]),
|
||||
monthLength = info[0];
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the gregorian date in the same timezone,
|
||||
// not what the gregorian date was at GMT time, so we adjust for the offset.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
for (var i = 0; i < hmonth; i++) {
|
||||
days += 29 + (monthLength & 1);
|
||||
monthLength = monthLength >> 1;
|
||||
}
|
||||
gdate.setDate(gdate.getDate() + days);
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
// Date's ticks in javascript are always from the GMT time,
|
||||
// but we are interested in the hijri date in the same timezone,
|
||||
// not what the hijri date was at GMT time, so we adjust for the offset.
|
||||
var ticks = gdate - gdate.getTimezoneOffset() * 60000;
|
||||
if (ticks < this.minDate || ticks > this.maxDate) return null;
|
||||
var hyear = 0,
|
||||
hmonth = 1;
|
||||
// find the earliest gregorian date in the array that is greater than or equal to the given date
|
||||
while (ticks > this._yearInfo[++hyear][1]) { }
|
||||
if (ticks !== this._yearInfo[hyear][1]) {
|
||||
hyear--;
|
||||
}
|
||||
var info = this._yearInfo[hyear],
|
||||
// how many days has it been since the date we found in the array?
|
||||
// 86400000 = ticks per day
|
||||
days = Math.floor((ticks - info[1]) / 86400000),
|
||||
monthLength = info[0];
|
||||
hyear += 1318; // the Nth array entry corresponds to hijri year 1318+N
|
||||
// now increment day/month based on the total days, considering
|
||||
// how many days are in each month. We cannot run past the year
|
||||
// mark since we would have found a different array entry in that case.
|
||||
var daysInMonth = 29 + (monthLength & 1);
|
||||
while (days >= daysInMonth) {
|
||||
days -= daysInMonth;
|
||||
monthLength = monthLength >> 1;
|
||||
daysInMonth = 29 + (monthLength & 1);
|
||||
hmonth++;
|
||||
}
|
||||
// remaining days is less than is in one month, thus is the day of the month we landed on
|
||||
// hmonth-1 because in javascript months are zero based, stay consistent with that.
|
||||
return [hyear, hmonth - 1, days + 1];
|
||||
}
|
||||
}
|
||||
},
|
||||
Hijri: {
|
||||
name: "Hijri",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""],
|
||||
namesAbbr: ["محرم","صفر","ربيع الأول","ربيع الثاني","جمادى الأولى","جمادى الثانية","رجب","شعبان","رمضان","شوال","ذو القعدة","ذو الحجة",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"بعد الهجرة","start":null,"offset":0}],
|
||||
twoDigitYearMax: 1451,
|
||||
patterns: {
|
||||
d: "dd/MM/yy",
|
||||
D: "dd/MM/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd/MM/yyyy hh:mm tt",
|
||||
F: "dd/MM/yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
},
|
||||
convert: {
|
||||
// Adapted to Script from System.Globalization.HijriCalendar
|
||||
ticks1970: 62135596800000,
|
||||
// number of days leading up to each month
|
||||
monthDays: [0, 30, 59, 89, 118, 148, 177, 207, 236, 266, 295, 325, 355],
|
||||
minDate: -42521673600000,
|
||||
maxDate: 253402300799999,
|
||||
// The number of days to add or subtract from the calendar to accommodate the variances
|
||||
// in the start and the end of Ramadan and to accommodate the date difference between
|
||||
// countries/regions. May be dynamically adjusted based on user preference, but should
|
||||
// remain in the range of -2 to 2, inclusive.
|
||||
hijriAdjustment: 0,
|
||||
toGregorian: function(hyear, hmonth, hday) {
|
||||
var daysSinceJan0101 = this.daysToYear(hyear) + this.monthDays[hmonth] + hday - 1 - this.hijriAdjustment;
|
||||
// 86400000 = ticks per day
|
||||
var gdate = new Date(daysSinceJan0101 * 86400000 - this.ticks1970);
|
||||
// adjust for timezone, because we are interested in the gregorian date for the same timezone
|
||||
// but ticks in javascript is always from GMT, unlike the server were ticks counts from the base
|
||||
// date in the current timezone.
|
||||
gdate.setMinutes(gdate.getMinutes() + gdate.getTimezoneOffset());
|
||||
return gdate;
|
||||
},
|
||||
fromGregorian: function(gdate) {
|
||||
if ((gdate < this.minDate) || (gdate > this.maxDate)) return null;
|
||||
var ticks = this.ticks1970 + (gdate-0) - gdate.getTimezoneOffset() * 60000,
|
||||
daysSinceJan0101 = Math.floor(ticks / 86400000) + 1 + this.hijriAdjustment;
|
||||
// very particular formula determined by someone smart, adapted from the server-side implementation.
|
||||
// it approximates the hijri year.
|
||||
var hday, hmonth, hyear = Math.floor(((daysSinceJan0101 - 227013) * 30) / 10631) + 1,
|
||||
absDays = this.daysToYear(hyear),
|
||||
daysInYear = this.isLeapYear(hyear) ? 355 : 354;
|
||||
// hyear is just approximate, it may need adjustment up or down by 1.
|
||||
if (daysSinceJan0101 < absDays) {
|
||||
hyear--;
|
||||
absDays -= daysInYear;
|
||||
}
|
||||
else if (daysSinceJan0101 === absDays) {
|
||||
hyear--;
|
||||
absDays = this.daysToYear(hyear);
|
||||
}
|
||||
else {
|
||||
if (daysSinceJan0101 > (absDays + daysInYear)) {
|
||||
absDays += daysInYear;
|
||||
hyear++;
|
||||
}
|
||||
}
|
||||
// determine month by looking at how many days into the hyear we are
|
||||
// monthDays contains the number of days up to each month.
|
||||
hmonth = 0;
|
||||
var daysIntoYear = daysSinceJan0101 - absDays;
|
||||
while (hmonth <= 11 && daysIntoYear > this.monthDays[hmonth]) {
|
||||
hmonth++;
|
||||
}
|
||||
hmonth--;
|
||||
hday = daysIntoYear - this.monthDays[hmonth];
|
||||
return [hyear, hmonth, hday];
|
||||
},
|
||||
daysToYear: function(year) {
|
||||
// calculates how many days since Jan 1, 0001
|
||||
var yearsToYear30 = Math.floor((year - 1) / 30) * 30,
|
||||
yearsInto30 = year - yearsToYear30 - 1,
|
||||
days = Math.floor((yearsToYear30 * 10631) / 30) + 227013;
|
||||
while (yearsInto30 > 0) {
|
||||
days += (this.isLeapYear(yearsInto30) ? 355 : 354);
|
||||
yearsInto30--;
|
||||
}
|
||||
return days;
|
||||
},
|
||||
isLeapYear: function(year) {
|
||||
return ((((year * 11) + 14) % 30) < 11);
|
||||
}
|
||||
}
|
||||
},
|
||||
Gregorian_MiddleEastFrench: {
|
||||
name: "Gregorian_MiddleEastFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],
|
||||
namesAbbr: ["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],
|
||||
namesShort: ["di","lu","ma","me","je","ve","sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],
|
||||
namesAbbr: ["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"ap. J.-C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_Arabic: {
|
||||
name: "Gregorian_Arabic",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""],
|
||||
namesAbbr: ["كانون الثاني","شباط","آذار","نيسان","أيار","حزيران","تموز","آب","أيلول","تشرين الأول","تشرين الثاني","كانون الأول",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
},
|
||||
Gregorian_Localized: {
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["يناير","فبراير","مارس","أبريل","مايو","يونيو","يوليو","أغسطس","سبتمبر","أكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dd MMMM, yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dd MMMM, yyyy hh:mm tt",
|
||||
F: "dd MMMM, yyyy hh:mm:ss tt",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
},
|
||||
Gregorian_TransliteratedFrench: {
|
||||
name: "Gregorian_TransliteratedFrench",
|
||||
firstDay: 6,
|
||||
days: {
|
||||
names: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesAbbr: ["الأحد","الإثنين","الثلاثاء","الأربعاء","الخميس","الجمعة","السبت"],
|
||||
namesShort: ["ح","ن","ث","ر","خ","ج","س"]
|
||||
},
|
||||
months: {
|
||||
names: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""],
|
||||
namesAbbr: ["جانفييه","فيفرييه","مارس","أفريل","مي","جوان","جوييه","أوت","سبتمبر","اكتوبر","نوفمبر","ديسمبر",""]
|
||||
},
|
||||
AM: ["ص","ص","ص"],
|
||||
PM: ["م","م","م"],
|
||||
eras: [{"name":"م","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "MM/dd/yyyy",
|
||||
t: "hh:mm tt",
|
||||
T: "hh:mm:ss tt",
|
||||
f: "dddd, MMMM dd, yyyy hh:mm tt",
|
||||
F: "dddd, MMMM dd, yyyy hh:mm:ss tt"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Globalize Culture arn-CL
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "arn-CL", "default", {
|
||||
name: "arn-CL",
|
||||
englishName: "Mapudungun (Chile)",
|
||||
nativeName: "Mapudungun (Chile)",
|
||||
language: "arn",
|
||||
numberFormat: {
|
||||
",": ".",
|
||||
".": ",",
|
||||
"NaN": "NeuN",
|
||||
negativeInfinity: "-Infinito",
|
||||
positiveInfinity: "Infinito",
|
||||
percent: {
|
||||
",": ".",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-$ n","$ n"],
|
||||
",": ".",
|
||||
".": ","
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": "-",
|
||||
days: {
|
||||
names: ["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],
|
||||
namesAbbr: ["dom","lun","mar","mié","jue","vie","sáb"],
|
||||
namesShort: ["do","lu","ma","mi","ju","vi","sá"]
|
||||
},
|
||||
months: {
|
||||
names: ["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],
|
||||
namesAbbr: ["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
eras: [{"name":"d.C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "dd-MM-yyyy",
|
||||
D: "dddd, dd' de 'MMMM' de 'yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, dd' de 'MMMM' de 'yyyy H:mm",
|
||||
F: "dddd, dd' de 'MMMM' de 'yyyy H:mm:ss",
|
||||
M: "dd MMMM",
|
||||
Y: "MMMM' de 'yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Globalize Culture arn
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "arn", "default", {
|
||||
name: "arn",
|
||||
englishName: "Mapudungun",
|
||||
nativeName: "Mapudungun",
|
||||
language: "arn",
|
||||
numberFormat: {
|
||||
",": ".",
|
||||
".": ",",
|
||||
"NaN": "NeuN",
|
||||
negativeInfinity: "-Infinito",
|
||||
positiveInfinity: "Infinito",
|
||||
percent: {
|
||||
",": ".",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-$ n","$ n"],
|
||||
",": ".",
|
||||
".": ","
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": "-",
|
||||
days: {
|
||||
names: ["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],
|
||||
namesAbbr: ["dom","lun","mar","mié","jue","vie","sáb"],
|
||||
namesShort: ["do","lu","ma","mi","ju","vi","sá"]
|
||||
},
|
||||
months: {
|
||||
names: ["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],
|
||||
namesAbbr: ["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
eras: [{"name":"d.C.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "dd-MM-yyyy",
|
||||
D: "dddd, dd' de 'MMMM' de 'yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "dddd, dd' de 'MMMM' de 'yyyy H:mm",
|
||||
F: "dddd, dd' de 'MMMM' de 'yyyy H:mm:ss",
|
||||
M: "dd MMMM",
|
||||
Y: "MMMM' de 'yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Globalize Culture as-IN
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "as-IN", "default", {
|
||||
name: "as-IN",
|
||||
englishName: "Assamese (India)",
|
||||
nativeName: "অসমীয়া (ভাৰত)",
|
||||
language: "as",
|
||||
numberFormat: {
|
||||
groupSizes: [3,2],
|
||||
"NaN": "nan",
|
||||
negativeInfinity: "-infinity",
|
||||
positiveInfinity: "infinity",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
groupSizes: [3,2]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$ -n","n$"],
|
||||
groupSizes: [3,2],
|
||||
symbol: "ট"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": "-",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["সোমবাৰ","মঙ্গলবাৰ","বুধবাৰ","বৃহস্পতিবাৰ","শুক্রবাৰ","শনিবাৰ","ৰবিবাৰ"],
|
||||
namesAbbr: ["সোম.","মঙ্গল.","বুধ.","বৃহ.","শুক্র.","শনি.","ৰবি."],
|
||||
namesShort: ["সো","ম","বু","বৃ","শু","শ","র"]
|
||||
},
|
||||
months: {
|
||||
names: ["জানুৱাৰী","ফেব্রুৱাৰী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগষ্ট","চেপ্টেম্বর","অক্টোবর","নবেম্বর","ডিচেম্বর",""],
|
||||
namesAbbr: ["জানু","ফেব্রু","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগষ্ট","চেপ্টে","অক্টো","নবে","ডিচে",""]
|
||||
},
|
||||
AM: ["ৰাতিপু","ৰাতিপু","ৰাতিপু"],
|
||||
PM: ["আবেলি","আবেলি","আবেলি"],
|
||||
eras: [{"name":"খ্রীষ্টাব্দ","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "dd-MM-yyyy",
|
||||
D: "yyyy,MMMM dd, dddd",
|
||||
t: "tt h:mm",
|
||||
T: "tt h:mm:ss",
|
||||
f: "yyyy,MMMM dd, dddd tt h:mm",
|
||||
F: "yyyy,MMMM dd, dddd tt h:mm:ss",
|
||||
M: "dd MMMM",
|
||||
Y: "MMMM,yy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* Globalize Culture as
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "as", "default", {
|
||||
name: "as",
|
||||
englishName: "Assamese",
|
||||
nativeName: "অসমীয়া",
|
||||
language: "as",
|
||||
numberFormat: {
|
||||
groupSizes: [3,2],
|
||||
"NaN": "nan",
|
||||
negativeInfinity: "-infinity",
|
||||
positiveInfinity: "infinity",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
groupSizes: [3,2]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$ -n","n$"],
|
||||
groupSizes: [3,2],
|
||||
symbol: "ট"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": "-",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["সোমবাৰ","মঙ্গলবাৰ","বুধবাৰ","বৃহস্পতিবাৰ","শুক্রবাৰ","শনিবাৰ","ৰবিবাৰ"],
|
||||
namesAbbr: ["সোম.","মঙ্গল.","বুধ.","বৃহ.","শুক্র.","শনি.","ৰবি."],
|
||||
namesShort: ["সো","ম","বু","বৃ","শু","শ","র"]
|
||||
},
|
||||
months: {
|
||||
names: ["জানুৱাৰী","ফেব্রুৱাৰী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগষ্ট","চেপ্টেম্বর","অক্টোবর","নবেম্বর","ডিচেম্বর",""],
|
||||
namesAbbr: ["জানু","ফেব্রু","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগষ্ট","চেপ্টে","অক্টো","নবে","ডিচে",""]
|
||||
},
|
||||
AM: ["ৰাতিপু","ৰাতিপু","ৰাতিপু"],
|
||||
PM: ["আবেলি","আবেলি","আবেলি"],
|
||||
eras: [{"name":"খ্রীষ্টাব্দ","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "dd-MM-yyyy",
|
||||
D: "yyyy,MMMM dd, dddd",
|
||||
t: "tt h:mm",
|
||||
T: "tt h:mm:ss",
|
||||
f: "yyyy,MMMM dd, dddd tt h:mm",
|
||||
F: "yyyy,MMMM dd, dddd tt h:mm:ss",
|
||||
M: "dd MMMM",
|
||||
Y: "MMMM,yy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Globalize Culture az-Cyrl-AZ
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "az-Cyrl-AZ", "default", {
|
||||
name: "az-Cyrl-AZ",
|
||||
englishName: "Azeri (Cyrillic, Azerbaijan)",
|
||||
nativeName: "Азәрбајҹан (Азәрбајҹан)",
|
||||
language: "az-Cyrl",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "ман."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["Базар","Базар ертәси","Чәршәнбә ахшамы","Чәршәнбә","Ҹүмә ахшамы","Ҹүмә","Шәнбә"],
|
||||
namesAbbr: ["Б","Бе","Ча","Ч","Ҹа","Ҹ","Ш"],
|
||||
namesShort: ["Б","Бе","Ча","Ч","Ҹа","Ҹ","Ш"]
|
||||
},
|
||||
months: {
|
||||
names: ["Јанвар","Феврал","Март","Апрел","Мај","Ијун","Ијул","Август","Сентјабр","Октјабр","Нојабр","Декабр",""],
|
||||
namesAbbr: ["Јан","Фев","Мар","Апр","Мај","Ијун","Ијул","Авг","Сен","Окт","Ноя","Дек",""]
|
||||
},
|
||||
monthsGenitive: {
|
||||
names: ["јанвар","феврал","март","апрел","мај","ијун","ијул","август","сентјабр","октјабр","нојабр","декабр",""],
|
||||
namesAbbr: ["Јан","Фев","Мар","Апр","мая","ијун","ијул","Авг","Сен","Окт","Ноя","Дек",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
patterns: {
|
||||
d: "dd.MM.yyyy",
|
||||
D: "d MMMM yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "d MMMM yyyy H:mm",
|
||||
F: "d MMMM yyyy H:mm:ss",
|
||||
M: "d MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Globalize Culture az-Cyrl
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "az-Cyrl", "default", {
|
||||
name: "az-Cyrl",
|
||||
englishName: "Azeri (Cyrillic)",
|
||||
nativeName: "Азәрбајҹан дили",
|
||||
language: "az-Cyrl",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "ман."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["Базар","Базар ертәси","Чәршәнбә ахшамы","Чәршәнбә","Ҹүмә ахшамы","Ҹүмә","Шәнбә"],
|
||||
namesAbbr: ["Б","Бе","Ча","Ч","Ҹа","Ҹ","Ш"],
|
||||
namesShort: ["Б","Бе","Ча","Ч","Ҹа","Ҹ","Ш"]
|
||||
},
|
||||
months: {
|
||||
names: ["Јанвар","Феврал","Март","Апрел","Мај","Ијун","Ијул","Август","Сентјабр","Октјабр","Нојабр","Декабр",""],
|
||||
namesAbbr: ["Јан","Фев","Мар","Апр","Мај","Ијун","Ијул","Авг","Сен","Окт","Ноя","Дек",""]
|
||||
},
|
||||
monthsGenitive: {
|
||||
names: ["јанвар","феврал","март","апрел","мај","ијун","ијул","август","сентјабр","октјабр","нојабр","декабр",""],
|
||||
namesAbbr: ["Јан","Фев","Мар","Апр","мая","ијун","ијул","Авг","Сен","Окт","Ноя","Дек",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
patterns: {
|
||||
d: "dd.MM.yyyy",
|
||||
D: "d MMMM yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "d MMMM yyyy H:mm",
|
||||
F: "d MMMM yyyy H:mm:ss",
|
||||
M: "d MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Globalize Culture az-Latn-AZ
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "az-Latn-AZ", "default", {
|
||||
name: "az-Latn-AZ",
|
||||
englishName: "Azeri (Latin, Azerbaijan)",
|
||||
nativeName: "Azərbaycan\xadılı (Azərbaycan)",
|
||||
language: "az-Latn",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "man."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"],
|
||||
namesAbbr: ["B","Be","Ça","Ç","Ca","C","Ş"],
|
||||
namesShort: ["B","Be","Ça","Ç","Ca","C","Ş"]
|
||||
},
|
||||
months: {
|
||||
names: ["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avgust","Sentyabr","Oktyabr","Noyabr","Dekabr",""],
|
||||
namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
|
||||
},
|
||||
monthsGenitive: {
|
||||
names: ["yanvar","fevral","mart","aprel","may","iyun","iyul","avgust","sentyabr","oktyabr","noyabr","dekabr",""],
|
||||
namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
patterns: {
|
||||
d: "dd.MM.yyyy",
|
||||
D: "d MMMM yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "d MMMM yyyy H:mm",
|
||||
F: "d MMMM yyyy H:mm:ss",
|
||||
M: "d MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Globalize Culture az-Latn
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "az-Latn", "default", {
|
||||
name: "az-Latn",
|
||||
englishName: "Azeri (Latin)",
|
||||
nativeName: "Azərbaycan\xadılı",
|
||||
language: "az-Latn",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "man."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"],
|
||||
namesAbbr: ["B","Be","Ça","Ç","Ca","C","Ş"],
|
||||
namesShort: ["B","Be","Ça","Ç","Ca","C","Ş"]
|
||||
},
|
||||
months: {
|
||||
names: ["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avgust","Sentyabr","Oktyabr","Noyabr","Dekabr",""],
|
||||
namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
|
||||
},
|
||||
monthsGenitive: {
|
||||
names: ["yanvar","fevral","mart","aprel","may","iyun","iyul","avgust","sentyabr","oktyabr","noyabr","dekabr",""],
|
||||
namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
patterns: {
|
||||
d: "dd.MM.yyyy",
|
||||
D: "d MMMM yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "d MMMM yyyy H:mm",
|
||||
F: "d MMMM yyyy H:mm:ss",
|
||||
M: "d MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Globalize Culture az
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "az", "default", {
|
||||
name: "az",
|
||||
englishName: "Azeri",
|
||||
nativeName: "Azərbaycan\xadılı",
|
||||
language: "az",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "man."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["Bazar","Bazar ertəsi","Çərşənbə axşamı","Çərşənbə","Cümə axşamı","Cümə","Şənbə"],
|
||||
namesAbbr: ["B","Be","Ça","Ç","Ca","C","Ş"],
|
||||
namesShort: ["B","Be","Ça","Ç","Ca","C","Ş"]
|
||||
},
|
||||
months: {
|
||||
names: ["Yanvar","Fevral","Mart","Aprel","May","İyun","İyul","Avgust","Sentyabr","Oktyabr","Noyabr","Dekabr",""],
|
||||
namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
|
||||
},
|
||||
monthsGenitive: {
|
||||
names: ["yanvar","fevral","mart","aprel","may","iyun","iyul","avgust","sentyabr","oktyabr","noyabr","dekabr",""],
|
||||
namesAbbr: ["Yan","Fev","Mar","Apr","May","İyun","İyul","Avg","Sen","Okt","Noy","Dek",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
patterns: {
|
||||
d: "dd.MM.yyyy",
|
||||
D: "d MMMM yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "d MMMM yyyy H:mm",
|
||||
F: "d MMMM yyyy H:mm:ss",
|
||||
M: "d MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Globalize Culture ba-RU
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ba-RU", "default", {
|
||||
name: "ba-RU",
|
||||
englishName: "Bashkir (Russia)",
|
||||
nativeName: "Башҡорт (Россия)",
|
||||
language: "ba",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
groupSizes: [3,0],
|
||||
negativeInfinity: "-бесконечность",
|
||||
positiveInfinity: "бесконечность",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
groupSizes: [3,0],
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
groupSizes: [3,0],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "һ."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["Йәкшәмбе","Дүшәмбе","Шишәмбе","Шаршамбы","Кесаҙна","Йома","Шәмбе"],
|
||||
namesAbbr: ["Йш","Дш","Шш","Шр","Кс","Йм","Шб"],
|
||||
namesShort: ["Йш","Дш","Шш","Шр","Кс","Йм","Шб"]
|
||||
},
|
||||
months: {
|
||||
names: ["ғинуар","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь",""],
|
||||
namesAbbr: ["ғин","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
patterns: {
|
||||
d: "dd.MM.yy",
|
||||
D: "d MMMM yyyy 'й'",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "d MMMM yyyy 'й' H:mm",
|
||||
F: "d MMMM yyyy 'й' H:mm:ss",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Globalize Culture ba
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "ba", "default", {
|
||||
name: "ba",
|
||||
englishName: "Bashkir",
|
||||
nativeName: "Башҡорт",
|
||||
language: "ba",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
groupSizes: [3,0],
|
||||
negativeInfinity: "-бесконечность",
|
||||
positiveInfinity: "бесконечность",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
groupSizes: [3,0],
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
groupSizes: [3,0],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "һ."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["Йәкшәмбе","Дүшәмбе","Шишәмбе","Шаршамбы","Кесаҙна","Йома","Шәмбе"],
|
||||
namesAbbr: ["Йш","Дш","Шш","Шр","Кс","Йм","Шб"],
|
||||
namesShort: ["Йш","Дш","Шш","Шр","Кс","Йм","Шб"]
|
||||
},
|
||||
months: {
|
||||
names: ["ғинуар","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь",""],
|
||||
namesAbbr: ["ғин","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
patterns: {
|
||||
d: "dd.MM.yy",
|
||||
D: "d MMMM yyyy 'й'",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "d MMMM yyyy 'й' H:mm",
|
||||
F: "d MMMM yyyy 'й' H:mm:ss",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Globalize Culture be-BY
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "be-BY", "default", {
|
||||
name: "be-BY",
|
||||
englishName: "Belarusian (Belarus)",
|
||||
nativeName: "Беларускі (Беларусь)",
|
||||
language: "be",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
percent: {
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "р."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["нядзеля","панядзелак","аўторак","серада","чацвер","пятніца","субота"],
|
||||
namesAbbr: ["нд","пн","аў","ср","чц","пт","сб"],
|
||||
namesShort: ["нд","пн","аў","ср","чц","пт","сб"]
|
||||
},
|
||||
months: {
|
||||
names: ["Студзень","Люты","Сакавік","Красавік","Май","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань",""],
|
||||
namesAbbr: ["Сту","Лют","Сак","Кра","Май","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сне",""]
|
||||
},
|
||||
monthsGenitive: {
|
||||
names: ["студзеня","лютага","сакавіка","красавіка","мая","чэрвеня","ліпеня","жніўня","верасня","кастрычніка","лістапада","снежня",""],
|
||||
namesAbbr: ["Сту","Лют","Сак","Кра","Май","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сне",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
patterns: {
|
||||
d: "dd.MM.yyyy",
|
||||
D: "d MMMM yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "d MMMM yyyy H:mm",
|
||||
F: "d MMMM yyyy H:mm:ss",
|
||||
M: "d MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+80
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Globalize Culture be
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "be", "default", {
|
||||
name: "be",
|
||||
englishName: "Belarusian",
|
||||
nativeName: "Беларускі",
|
||||
language: "be",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
percent: {
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "р."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["нядзеля","панядзелак","аўторак","серада","чацвер","пятніца","субота"],
|
||||
namesAbbr: ["нд","пн","аў","ср","чц","пт","сб"],
|
||||
namesShort: ["нд","пн","аў","ср","чц","пт","сб"]
|
||||
},
|
||||
months: {
|
||||
names: ["Студзень","Люты","Сакавік","Красавік","Май","Чэрвень","Ліпень","Жнівень","Верасень","Кастрычнік","Лістапад","Снежань",""],
|
||||
namesAbbr: ["Сту","Лют","Сак","Кра","Май","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сне",""]
|
||||
},
|
||||
monthsGenitive: {
|
||||
names: ["студзеня","лютага","сакавіка","красавіка","мая","чэрвеня","ліпеня","жніўня","верасня","кастрычніка","лістапада","снежня",""],
|
||||
namesAbbr: ["Сту","Лют","Сак","Кра","Май","Чэр","Ліп","Жні","Вер","Кас","Ліс","Сне",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
patterns: {
|
||||
d: "dd.MM.yyyy",
|
||||
D: "d MMMM yyyy",
|
||||
t: "H:mm",
|
||||
T: "H:mm:ss",
|
||||
f: "d MMMM yyyy H:mm",
|
||||
F: "d MMMM yyyy H:mm:ss",
|
||||
M: "d MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Globalize Culture bg-BG
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "bg-BG", "default", {
|
||||
name: "bg-BG",
|
||||
englishName: "Bulgarian (Bulgaria)",
|
||||
nativeName: "български (България)",
|
||||
language: "bg",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
negativeInfinity: "- безкрайност",
|
||||
positiveInfinity: "+ безкрайност",
|
||||
percent: {
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "лв."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"],
|
||||
namesAbbr: ["нед","пон","вт","ср","четв","пет","съб"],
|
||||
namesShort: ["н","п","в","с","ч","п","с"]
|
||||
},
|
||||
months: {
|
||||
names: ["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември",""],
|
||||
namesAbbr: ["ян","февр","март","апр","май","юни","юли","авг","септ","окт","ноември","дек",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
eras: [{"name":"след новата ера","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "d.M.yyyy 'г.'",
|
||||
D: "dd MMMM yyyy 'г.'",
|
||||
t: "HH:mm 'ч.'",
|
||||
T: "HH:mm:ss 'ч.'",
|
||||
f: "dd MMMM yyyy 'г.' HH:mm 'ч.'",
|
||||
F: "dd MMMM yyyy 'г.' HH:mm:ss 'ч.'",
|
||||
M: "dd MMMM",
|
||||
Y: "MMMM yyyy 'г.'"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Globalize Culture bg
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "bg", "default", {
|
||||
name: "bg",
|
||||
englishName: "Bulgarian",
|
||||
nativeName: "български",
|
||||
language: "bg",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
negativeInfinity: "- безкрайност",
|
||||
positiveInfinity: "+ безкрайност",
|
||||
percent: {
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "лв."
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["неделя","понеделник","вторник","сряда","четвъртък","петък","събота"],
|
||||
namesAbbr: ["нед","пон","вт","ср","четв","пет","съб"],
|
||||
namesShort: ["н","п","в","с","ч","п","с"]
|
||||
},
|
||||
months: {
|
||||
names: ["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември",""],
|
||||
namesAbbr: ["ян","февр","март","апр","май","юни","юли","авг","септ","окт","ноември","дек",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
eras: [{"name":"след новата ера","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "d.M.yyyy 'г.'",
|
||||
D: "dd MMMM yyyy 'г.'",
|
||||
t: "HH:mm 'ч.'",
|
||||
T: "HH:mm:ss 'ч.'",
|
||||
f: "dd MMMM yyyy 'г.' HH:mm 'ч.'",
|
||||
F: "dd MMMM yyyy 'г.' HH:mm:ss 'ч.'",
|
||||
M: "dd MMMM",
|
||||
Y: "MMMM yyyy 'г.'"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Globalize Culture bn-BD
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "bn-BD", "default", {
|
||||
name: "bn-BD",
|
||||
englishName: "Bengali (Bangladesh)",
|
||||
nativeName: "বাংলা (বাংলাদেশ)",
|
||||
language: "bn",
|
||||
numberFormat: {
|
||||
groupSizes: [3,2],
|
||||
percent: {
|
||||
pattern: ["-%n","%n"],
|
||||
groupSizes: [3,2]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$ -n","$ n"],
|
||||
groupSizes: [3,2],
|
||||
symbol: "৳"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": "-",
|
||||
":": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার","শুক্রবার","শনিবার"],
|
||||
namesAbbr: ["রবি.","সোম.","মঙ্গল.","বুধ.","বৃহস্পতি.","শুক্র.","শনি."],
|
||||
namesShort: ["র","স","ম","ব","ব","শ","শ"]
|
||||
},
|
||||
months: {
|
||||
names: ["জানুয়ারী","ফেব্রুয়ারী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর",""],
|
||||
namesAbbr: ["জানু.","ফেব্রু.","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগ.","সেপ্টে.","অক্টো.","নভে.","ডিসে.",""]
|
||||
},
|
||||
AM: ["পুর্বাহ্ন","পুর্বাহ্ন","পুর্বাহ্ন"],
|
||||
PM: ["অপরাহ্ন","অপরাহ্ন","অপরাহ্ন"],
|
||||
patterns: {
|
||||
d: "dd-MM-yy",
|
||||
D: "dd MMMM yyyy",
|
||||
t: "HH.mm",
|
||||
T: "HH.mm.ss",
|
||||
f: "dd MMMM yyyy HH.mm",
|
||||
F: "dd MMMM yyyy HH.mm.ss",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Globalize Culture bn-IN
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "bn-IN", "default", {
|
||||
name: "bn-IN",
|
||||
englishName: "Bengali (India)",
|
||||
nativeName: "বাংলা (ভারত)",
|
||||
language: "bn",
|
||||
numberFormat: {
|
||||
groupSizes: [3,2],
|
||||
percent: {
|
||||
pattern: ["-%n","%n"],
|
||||
groupSizes: [3,2]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$ -n","$ n"],
|
||||
groupSizes: [3,2],
|
||||
symbol: "টা"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": "-",
|
||||
":": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার","শুক্রবার","শনিবার"],
|
||||
namesAbbr: ["রবি.","সোম.","মঙ্গল.","বুধ.","বৃহস্পতি.","শুক্র.","শনি."],
|
||||
namesShort: ["র","স","ম","ব","ব","শ","শ"]
|
||||
},
|
||||
months: {
|
||||
names: ["জানুয়ারী","ফেব্রুয়ারী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর",""],
|
||||
namesAbbr: ["জানু.","ফেব্রু.","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগ.","সেপ্টে.","অক্টো.","নভে.","ডিসে.",""]
|
||||
},
|
||||
AM: ["পুর্বাহ্ন","পুর্বাহ্ন","পুর্বাহ্ন"],
|
||||
PM: ["অপরাহ্ন","অপরাহ্ন","অপরাহ্ন"],
|
||||
patterns: {
|
||||
d: "dd-MM-yy",
|
||||
D: "dd MMMM yyyy",
|
||||
t: "HH.mm",
|
||||
T: "HH.mm.ss",
|
||||
f: "dd MMMM yyyy HH.mm",
|
||||
F: "dd MMMM yyyy HH.mm.ss",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Globalize Culture bn
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "bn", "default", {
|
||||
name: "bn",
|
||||
englishName: "Bengali",
|
||||
nativeName: "বাংলা",
|
||||
language: "bn",
|
||||
numberFormat: {
|
||||
groupSizes: [3,2],
|
||||
percent: {
|
||||
pattern: ["-%n","%n"],
|
||||
groupSizes: [3,2]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$ -n","$ n"],
|
||||
groupSizes: [3,2],
|
||||
symbol: "টা"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
"/": "-",
|
||||
":": ".",
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["রবিবার","সোমবার","মঙ্গলবার","বুধবার","বৃহস্পতিবার","শুক্রবার","শনিবার"],
|
||||
namesAbbr: ["রবি.","সোম.","মঙ্গল.","বুধ.","বৃহস্পতি.","শুক্র.","শনি."],
|
||||
namesShort: ["র","স","ম","ব","ব","শ","শ"]
|
||||
},
|
||||
months: {
|
||||
names: ["জানুয়ারী","ফেব্রুয়ারী","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগস্ট","সেপ্টেম্বর","অক্টোবর","নভেম্বর","ডিসেম্বর",""],
|
||||
namesAbbr: ["জানু.","ফেব্রু.","মার্চ","এপ্রিল","মে","জুন","জুলাই","আগ.","সেপ্টে.","অক্টো.","নভে.","ডিসে.",""]
|
||||
},
|
||||
AM: ["পুর্বাহ্ন","পুর্বাহ্ন","পুর্বাহ্ন"],
|
||||
PM: ["অপরাহ্ন","অপরাহ্ন","অপরাহ্ন"],
|
||||
patterns: {
|
||||
d: "dd-MM-yy",
|
||||
D: "dd MMMM yyyy",
|
||||
t: "HH.mm",
|
||||
T: "HH.mm.ss",
|
||||
f: "dd MMMM yyyy HH.mm",
|
||||
F: "dd MMMM yyyy HH.mm.ss",
|
||||
M: "dd MMMM"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Globalize Culture bo-CN
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "bo-CN", "default", {
|
||||
name: "bo-CN",
|
||||
englishName: "Tibetan (PRC)",
|
||||
nativeName: "བོད་ཡིག (ཀྲུང་ཧྭ་མི་དམངས་སྤྱི་མཐུན་རྒྱལ་ཁབ།)",
|
||||
language: "bo",
|
||||
numberFormat: {
|
||||
groupSizes: [3,0],
|
||||
"NaN": "ཨང་ཀི་མིན་པ།",
|
||||
negativeInfinity: "མོ་གྲངས་ཚད་མེད་ཆུང་བ།",
|
||||
positiveInfinity: "ཕོ་གྲངས་ཚད་མེད་ཆེ་བ།",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
groupSizes: [3,0]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$-n","$n"],
|
||||
groupSizes: [3,0],
|
||||
symbol: "¥"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["གཟའ་ཉི་མ།","གཟའ་ཟླ་བ།","གཟའ་མིག་དམར།","གཟའ་ལྷག་པ།","གཟའ་ཕུར་བུ།","གཟའ་པ་སངས།","གཟའ་སྤེན་པ།"],
|
||||
namesAbbr: ["ཉི་མ།","ཟླ་བ།","མིག་དམར།","ལྷག་པ།","ཕུར་བུ།","པ་སངས།","སྤེན་པ།"],
|
||||
namesShort: ["༧","༡","༢","༣","༤","༥","༦"]
|
||||
},
|
||||
months: {
|
||||
names: ["སྤྱི་ཟླ་དང་པོ།","སྤྱི་ཟླ་གཉིས་པ།","སྤྱི་ཟླ་གསུམ་པ།","སྤྱི་ཟླ་བཞི་པ།","སྤྱི་ཟླ་ལྔ་པ།","སྤྱི་ཟླ་དྲུག་པ།","སྤྱི་ཟླ་བདུན་པ།","སྤྱི་ཟླ་བརྒྱད་པ།","སྤྱི་ཟླ་དགུ་པ།","སྤྱི་ཟླ་བཅུ་པོ།","སྤྱི་ཟླ་བཅུ་གཅིག་པ།","སྤྱི་ཟླ་བཅུ་གཉིས་པ།",""],
|
||||
namesAbbr: ["ཟླ་ ༡","ཟླ་ ༢","ཟླ་ ༣","ཟླ་ ༤","ཟླ་ ༥","ཟླ་ ༦","ཟླ་ ༧","ཟླ་ ༨","ཟླ་ ༩","ཟླ་ ༡༠","ཟླ་ ༡༡","ཟླ་ ༡༢",""]
|
||||
},
|
||||
AM: ["སྔ་དྲོ","སྔ་དྲོ","སྔ་དྲོ"],
|
||||
PM: ["ཕྱི་དྲོ","ཕྱི་དྲོ","ཕྱི་དྲོ"],
|
||||
eras: [{"name":"སྤྱི་ལོ","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "yyyy/M/d",
|
||||
D: "yyyy'ལོའི་ཟླ' M'ཚེས' d",
|
||||
t: "HH:mm",
|
||||
T: "HH:mm:ss",
|
||||
f: "yyyy'ལོའི་ཟླ' M'ཚེས' d HH:mm",
|
||||
F: "yyyy'ལོའི་ཟླ' M'ཚེས' d HH:mm:ss",
|
||||
M: "'ཟླ་' M'ཚེས'd",
|
||||
Y: "yyyy.M"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* Globalize Culture bo
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "bo", "default", {
|
||||
name: "bo",
|
||||
englishName: "Tibetan",
|
||||
nativeName: "བོད་ཡིག",
|
||||
language: "bo",
|
||||
numberFormat: {
|
||||
groupSizes: [3,0],
|
||||
"NaN": "ཨང་ཀི་མིན་པ།",
|
||||
negativeInfinity: "མོ་གྲངས་ཚད་མེད་ཆུང་བ།",
|
||||
positiveInfinity: "ཕོ་གྲངས་ཚད་མེད་ཆེ་བ།",
|
||||
percent: {
|
||||
pattern: ["-n%","n%"],
|
||||
groupSizes: [3,0]
|
||||
},
|
||||
currency: {
|
||||
pattern: ["$-n","$n"],
|
||||
groupSizes: [3,0],
|
||||
symbol: "¥"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["གཟའ་ཉི་མ།","གཟའ་ཟླ་བ།","གཟའ་མིག་དམར།","གཟའ་ལྷག་པ།","གཟའ་ཕུར་བུ།","གཟའ་པ་སངས།","གཟའ་སྤེན་པ།"],
|
||||
namesAbbr: ["ཉི་མ།","ཟླ་བ།","མིག་དམར།","ལྷག་པ།","ཕུར་བུ།","པ་སངས།","སྤེན་པ།"],
|
||||
namesShort: ["༧","༡","༢","༣","༤","༥","༦"]
|
||||
},
|
||||
months: {
|
||||
names: ["སྤྱི་ཟླ་དང་པོ།","སྤྱི་ཟླ་གཉིས་པ།","སྤྱི་ཟླ་གསུམ་པ།","སྤྱི་ཟླ་བཞི་པ།","སྤྱི་ཟླ་ལྔ་པ།","སྤྱི་ཟླ་དྲུག་པ།","སྤྱི་ཟླ་བདུན་པ།","སྤྱི་ཟླ་བརྒྱད་པ།","སྤྱི་ཟླ་དགུ་པ།","སྤྱི་ཟླ་བཅུ་པོ།","སྤྱི་ཟླ་བཅུ་གཅིག་པ།","སྤྱི་ཟླ་བཅུ་གཉིས་པ།",""],
|
||||
namesAbbr: ["ཟླ་ ༡","ཟླ་ ༢","ཟླ་ ༣","ཟླ་ ༤","ཟླ་ ༥","ཟླ་ ༦","ཟླ་ ༧","ཟླ་ ༨","ཟླ་ ༩","ཟླ་ ༡༠","ཟླ་ ༡༡","ཟླ་ ༡༢",""]
|
||||
},
|
||||
AM: ["སྔ་དྲོ","སྔ་དྲོ","སྔ་དྲོ"],
|
||||
PM: ["ཕྱི་དྲོ","ཕྱི་དྲོ","ཕྱི་དྲོ"],
|
||||
eras: [{"name":"སྤྱི་ལོ","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "yyyy/M/d",
|
||||
D: "yyyy'ལོའི་ཟླ' M'ཚེས' d",
|
||||
t: "HH:mm",
|
||||
T: "HH:mm:ss",
|
||||
f: "yyyy'ལོའི་ཟླ' M'ཚེས' d HH:mm",
|
||||
F: "yyyy'ལོའི་ཟླ' M'ཚེས' d HH:mm:ss",
|
||||
M: "'ཟླ་' M'ཚེས'd",
|
||||
Y: "yyyy.M"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Globalize Culture br-FR
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "br-FR", "default", {
|
||||
name: "br-FR",
|
||||
englishName: "Breton (France)",
|
||||
nativeName: "brezhoneg (Frañs)",
|
||||
language: "br",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
"NaN": "NkN",
|
||||
negativeInfinity: "-Anfin",
|
||||
positiveInfinity: "+Anfin",
|
||||
percent: {
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "€"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["Sul","Lun","Meurzh","Merc'her","Yaou","Gwener","Sadorn"],
|
||||
namesAbbr: ["Sul","Lun","Meu.","Mer.","Yaou","Gwe.","Sad."],
|
||||
namesShort: ["Su","Lu","Mz","Mc","Ya","Gw","Sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["Genver","C'hwevrer","Meurzh","Ebrel","Mae","Mezheven","Gouere","Eost","Gwengolo","Here","Du","Kerzu",""],
|
||||
namesAbbr: ["Gen.","C'hwe.","Meur.","Ebr.","Mae","Mezh.","Goue.","Eost","Gwen.","Here","Du","Kzu",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
eras: [{"name":"g. J.-K.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dddd d MMMM yyyy",
|
||||
t: "HH:mm",
|
||||
T: "HH:mm:ss",
|
||||
f: "dddd d MMMM yyyy HH:mm",
|
||||
F: "dddd d MMMM yyyy HH:mm:ss",
|
||||
M: "d MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* Globalize Culture br
|
||||
*
|
||||
* http://github.com/jquery/globalize
|
||||
*
|
||||
* Copyright Software Freedom Conservancy, Inc.
|
||||
* Dual licensed under the MIT or GPL Version 2 licenses.
|
||||
* http://jquery.org/license
|
||||
*
|
||||
* This file was generated by the Globalize Culture Generator
|
||||
* Translation: bugs found in this file need to be fixed in the generator
|
||||
*/
|
||||
|
||||
(function( window, undefined ) {
|
||||
|
||||
var Globalize;
|
||||
|
||||
if ( typeof require !== "undefined" &&
|
||||
typeof exports !== "undefined" &&
|
||||
typeof module !== "undefined" ) {
|
||||
// Assume CommonJS
|
||||
Globalize = require( "globalize" );
|
||||
} else {
|
||||
// Global variable
|
||||
Globalize = window.Globalize;
|
||||
}
|
||||
|
||||
Globalize.addCultureInfo( "br", "default", {
|
||||
name: "br",
|
||||
englishName: "Breton",
|
||||
nativeName: "brezhoneg",
|
||||
language: "br",
|
||||
numberFormat: {
|
||||
",": " ",
|
||||
".": ",",
|
||||
"NaN": "NkN",
|
||||
negativeInfinity: "-Anfin",
|
||||
positiveInfinity: "+Anfin",
|
||||
percent: {
|
||||
",": " ",
|
||||
".": ","
|
||||
},
|
||||
currency: {
|
||||
pattern: ["-n $","n $"],
|
||||
",": " ",
|
||||
".": ",",
|
||||
symbol: "€"
|
||||
}
|
||||
},
|
||||
calendars: {
|
||||
standard: {
|
||||
firstDay: 1,
|
||||
days: {
|
||||
names: ["Sul","Lun","Meurzh","Merc'her","Yaou","Gwener","Sadorn"],
|
||||
namesAbbr: ["Sul","Lun","Meu.","Mer.","Yaou","Gwe.","Sad."],
|
||||
namesShort: ["Su","Lu","Mz","Mc","Ya","Gw","Sa"]
|
||||
},
|
||||
months: {
|
||||
names: ["Genver","C'hwevrer","Meurzh","Ebrel","Mae","Mezheven","Gouere","Eost","Gwengolo","Here","Du","Kerzu",""],
|
||||
namesAbbr: ["Gen.","C'hwe.","Meur.","Ebr.","Mae","Mezh.","Goue.","Eost","Gwen.","Here","Du","Kzu",""]
|
||||
},
|
||||
AM: null,
|
||||
PM: null,
|
||||
eras: [{"name":"g. J.-K.","start":null,"offset":0}],
|
||||
patterns: {
|
||||
d: "dd/MM/yyyy",
|
||||
D: "dddd d MMMM yyyy",
|
||||
t: "HH:mm",
|
||||
T: "HH:mm:ss",
|
||||
f: "dddd d MMMM yyyy HH:mm",
|
||||
F: "dddd d MMMM yyyy HH:mm:ss",
|
||||
M: "d MMMM",
|
||||
Y: "MMMM yyyy"
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}( this ));
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user